[
https://issues.apache.org/jira/browse/PHOENIX-2671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15145865#comment-15145865
]
James Taylor commented on PHOENIX-2671:
---------------------------------------
Thanks for the patch, [~ankit.singhal]. Looks very good, with a couple of
minor, fix on commit nits:
- Just move the statsTableKey creation before the Get here - no reason to do it
twice:
{code}
- List<Cell> columnCells = metaTable
.get(new Get(SchemaUtil.getTableKey(null,
PhoenixDatabaseMetaData.SYSTEM_SCHEMA_NAME,
- PhoenixDatabaseMetaData.SYSTEM_CATALOG_TABLE)))
+ PhoenixDatabaseMetaData.SYSTEM_STATS_NAME)))
.getColumnCells(PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES,
QueryConstants.EMPTY_COLUMN_BYTES);
{code}
- In the checkAndPut, no reason to change the timestamp of the SYSTEM.STATS
row. Just use the same timestamp from the Get above:
{code}
if (!columnCells.isEmpty()
&& columnCells.get(0).getTimestamp() <
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_7_0) {
@@ -1232,7 +1232,7 @@ public class UpgradeUtil {
PhoenixDatabaseMetaData.SYSTEM_STATS_TABLE);
KeyValue upgradeKV = KeyValueUtil.newKeyValue(statsTableKey,
PhoenixDatabaseMetaData.TABLE_FAMILY_BYTES,
UPGRADE_TO_4_7_COLUMN_NAME,
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP_4_7_0 - 1,
- ByteUtil.EMPTY_BYTE_ARRAY);
+ PBoolean.INSTANCE.toBytes(true));
{code}
> System.STATS table getting truncated every time on new client connection
> ------------------------------------------------------------------------
>
> Key: PHOENIX-2671
> URL: https://issues.apache.org/jira/browse/PHOENIX-2671
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.7.0
> Reporter: Mujtaba Chohan
> Assignee: Ankit Singhal
> Priority: Blocker
> Fix For: 4.7.0
>
> Attachments: PHOENIX-2671.patch, PHOENIX-2671_v1.patch
>
>
> Every time a client connects, SYSTEM.STATS table gets truncated.
> Log:
> {code}
> coprocessor.MetaDataRegionObserver: Stats are successfully truncated for
> upgrade 4.7!!
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)