gourabtaparia commented on code in PR #1534:
URL: https://github.com/apache/phoenix/pull/1534#discussion_r1048094125


##########
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java:
##########
@@ -4373,10 +4380,39 @@ private PhoenixConnection upgradeSystemSequence(
             } else {
                 nSequenceSaltBuckets = getSaltBuckets(e);
             }
+
+            updateSystemSequenceWithCacheOnWriteProps(metaConnection);
         }
         return metaConnection;
     }
 
+    private void updateSystemSequenceWithCacheOnWriteProps(PhoenixConnection 
metaConnection) throws
+        IOException, SQLException {
+
+        try (Admin admin = getAdmin()) {
+            PTable pTable = PhoenixRuntime.getTable(metaConnection,
+                PhoenixDatabaseMetaData.SYSTEM_SEQUENCE_NAME);
+            TableDescriptor oldTD = admin.getDescriptor(
+                
SchemaUtil.getPhysicalTableName(PhoenixDatabaseMetaData.SYSTEM_SEQUENCE_NAME,
+                    metaConnection.getQueryServices().getProps()));
+            ColumnFamilyDescriptor oldCf = oldTD.getColumnFamily(
+                SchemaUtil.getEmptyColumnFamily(pTable));

Review Comment:
   Aah got it. My thought was to use the utility method, and avoid writing the 
underlying defaulting logic ourself. 
   
   But i get it now :) avoiding the PhoenixRuntime is also a plus. Will make 
the change.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to