Copilot commented on code in PR #2611:
URL: https://github.com/apache/phoenix/pull/2611#discussion_r3918152354


##########
phoenix-core-client/src/main/java/org/apache/phoenix/index/IndexMaintainer.java:
##########
@@ -198,11 +196,9 @@ public static Iterator<PTable> 
maintainedLocalOrGlobalIndexesWithoutMatchingStor
     return Iterators.filter(indexes, new Predicate<PTable>() {
       @Override
       public boolean apply(PTable index) {
-        return sendIndexMaintainer(index) && ((index.getIndexType() == 
IndexType.GLOBAL
+        return sendIndexMaintainer(index) && ((IndexUtil.isGlobalIndex(index)
           && (dataTable.getImmutableStorageScheme() != 
index.getImmutableStorageScheme()
-            || connection.getQueryServices().getConfiguration().getBoolean(
-              SERVER_SIDE_IMMUTABLE_INDEXES_ENABLED_ATTRIB,
-              DEFAULT_SERVER_SIDE_IMMUTABLE_INDEXES_ENABLED)))
+            || 
IndexUtil.isServerSideImmutableIndexMaintenanceEnabled(dataTable, connection)))

Review Comment:
   The storage-scheme mismatch branch bypasses the new `ROW_TIMESTAMP` guard. 
For an immutable `ROW_TIMESTAMP` table whose global index uses a different 
immutable storage scheme, `getClientMaintainedIndexes` excludes that index 
because the schemes differ, while this predicate still serializes it because 
the left side of the `||` is true. `IndexRegionObserver` will therefore remain 
the sole maintainer and `setTimestamps` will replace the user timestamp, 
contradicting the carve-out and preserving the range-scan/SCN corruption 
described by this PR. Please make the client/server routing cover this 
combination explicitly (either safely client-maintain it or preserve row 
timestamps in the required server read-back path).



-- 
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