kadirozde commented on a change in pull request #701: PHOENIX-5709 Simplify 
index update generation code for consistent glo…
URL: https://github.com/apache/phoenix/pull/701#discussion_r382941470
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/coprocessor/IndexRebuildRegionScanner.java
 ##########
 @@ -823,6 +844,42 @@ private boolean verifySingleIndexRow(Result indexRow, 
VerificationResult.PhaseRe
             if (actualMutationIndex == actualMutationList.size()) {
                 break;
             }
+            // Skip newer expected unverified put or delete mutations
+            if (getTimestamp(expectedMutation) > getTimestamp(actualMutation) 
&&
+                    ((expectedMutation instanceof Put && 
!isVerified(expectedMutation) && expectedMutation.size() == 1) ||
+                            (expectedMutation instanceof Delete))) {
+                // The reason there is no corresponding actual index row 
mutations is because of concurrent data
+                // table mutations. For each data table mutation, two 
operations are done on the data table. One is to
+                // read the existing row state, and the second is to write to 
the data table. The processing of
+                // concurrent data mutations are serialized once for reading 
the existing row states, and then
+                // serialized again for updating data table. In other words, 
they go through locking twice, i.e.,
+                // [lock, read, unlock] and [lock, write, unlock]. Because of 
this two phase locking, for a pair of
+                // concurrent mutations(for the same row), the same row state 
is read from the data table. This means
+                // the same existing index row can be made unverified twice 
with different timestamps, one for each
+                // the concurrent mutation. So skipping newer expected 
unverified put mutation are safe. One of these
+                // unverified put mutations is later cleaned up by delete 
markers by the read repair process.
+                // We can skipped these delete markers safely above. When the 
data table rows are rebuild, the rebuild
+                // process generates the delete family markers. The timestamp 
of delete markers are the timestamp of
 
 Review comment:
   ok

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to