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


##########
phoenix-core-server/src/main/java/org/apache/phoenix/hbase/index/IndexRegionObserver.java:
##########
@@ -1985,6 +2023,8 @@ public void 
preBatchMutateWithExceptions(ObserverContext<RegionCoprocessorEnviro
           || context.hasStrictConditionalTTL()
           || !context.immutableRows && context.hasUncoveredIndex
             && isPartialUncoveredIndexMutation(indexMetaData, miniBatchOp)
+          || context.immutableRows && (context.hasGlobalIndex || 
context.hasUncoveredIndex)

Review Comment:
   Before this change, immutable indexes were maintained entirely on the 
client: each index mutation was built from only the columns present in the 
current upsert, with no read-back. So a partial upsert produced an index row 
from just those columns, and correctness was recovered lazily at read time — 
GlobalIndexChecker's two-phase verified/unverified protocol rebuilds the index 
row from the full data-table row on read. Uncovered indexes weren't maintained 
at write time at all.
   
    Now that the server maintains immutable indexes at write time, a partial 
mutation no longer carries every column the index needs, so we have to read the 
current row state to build a correct entry. This check gates that read-back to 
the immutable global/uncovered case on partial mutations 
(isPartialGlobalIndexMutation), matching what the mutable path already does; 
full upserts (all index columns present) still skip it.



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