[ 
https://issues.apache.org/jira/browse/PHOENIX-1641?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14310305#comment-14310305
 ] 

James Taylor commented on PHOENIX-1641:
---------------------------------------

Looked at this again, and I think we should check-in an addendum:
- This check in UpgradeUtil doesn't look right, as 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP is now higher that it was before. 
It should compare against the value of 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP as of 4.2.1, as this code is only 
needed if you upgraded to 4.2.1 and then moved to 4.2.2 (as the presplit part 
wasn't done as it should have been for 4.2.1)
{code}
                if (oldTable.getTimeStamp() == 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP-1) {
{code}
- In general, I think it's better to compare the oldTable.getTimeStamp() 
against a static number, rather than relative to MIN_SYSTEM_TABLE_TIMESTAMP, as 
this value will keep growing (and we'd have to continually change this code 
then). Can you instead have separate static constants for 
MIN_SYSTEM_TABLE_TIMESTAMP_4_1_0, MIN_SYSTEM_TABLE_TIMESTAMP_4_2_1, etc and 
compare against those instead.
- I don't think your other change to UpgradeUtil is necessary (but if you think 
it is, then please let me know):
{code}
+            // if the SYSTEM.SEQUENCE table is for 4.1.0 or before then we 
need to salt the table
+            if (oldTable.getTimeStamp() <= 
MetaDataProtocol.MIN_SYSTEM_TABLE_TIMESTAMP - 3) {
                 int batchSizeBytes = 100 * 1024; // 100K chunks
                 int sizeBytes = 0;
                 List<Mutation> mutations =  
Lists.newArrayListWithExpectedSize(10000);
@@ -342,6 +344,8 @@ public class UpgradeUtil {
                         logger.warn("Exception during close",e);
                     }
                 }
+            }
+            return false;
{code}

> Make the upgrade for SYSTEM.CATALOG and SYSTEM.SEQUENCE work for 4.x to 4.3
> ---------------------------------------------------------------------------
>
>                 Key: PHOENIX-1641
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1641
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: Samarth Jain
>            Assignee: Samarth Jain
>             Fix For: 5.0.0, 4.3
>
>         Attachments: PHOENIX-1641.patch, PHOENIX-1641_v2.patch
>
>
> The code got removed in the commit: 
> https://github.com/apache/phoenix/commit/58c80a1857659962d695bc8e5fe22b4e401b7f0a
>  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to