Github user samarthjain commented on a diff in the pull request:

    https://github.com/apache/phoenix/pull/133#discussion_r45683493
  
    --- Diff: 
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java ---
    @@ -1268,19 +1312,19 @@ public MutationState 
createIndex(CreateIndexStatement statement, byte[][] splits
                     // as there's no need to burn another sequence value.
                     if (allocateIndexId && indexId == null) {
                         Long scn = connection.getSCN();
    -                    long timestamp = scn == null ? 
HConstants.LATEST_TIMESTAMP : scn;
                         PName tenantId = connection.getTenantId();
                         String tenantIdStr = tenantId == null ? null : 
connection.getTenantId().getString();
                         PName physicalName = dataTable.getPhysicalName();
                         int nSequenceSaltBuckets = 
connection.getQueryServices().getSequenceSaltBuckets();
                         SequenceKey key = 
MetaDataUtil.getViewIndexSequenceKey(tenantIdStr, physicalName, 
nSequenceSaltBuckets);
    -                    // Create at parent timestamp as we know that will be 
earlier than now
    -                    // and earlier than any SCN if one is set.
    +                    // if scn is set create at scn-1, so we can see the 
sequence or else use latest timestamp (so that latest server time is used)
    +                    long sequenceTimestamp = scn!=null ? scn-1 : 
HConstants.LATEST_TIMESTAMP;
    --- End diff --
    
    Are we treating sequences specially? If I remember correctly, if you create 
a table with connection timestamp as SCN, then the table becomes visible at SCN 
+ 1. Has that changed? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to