kadirozde commented on a change in pull request #624: PHOENIX-5564 Restructure 
read repair to improve readability and corre…
URL: https://github.com/apache/phoenix/pull/624#discussion_r345981892
 
 

 ##########
 File path: 
phoenix-core/src/main/java/org/apache/phoenix/index/GlobalIndexChecker.java
 ##########
 @@ -70,10 +70,31 @@
  * 
  * Coprocessor that verifies the scanned rows of a non-transactional global 
index.
  *
+ * If an index row is unverified (i.e., the row status is unverified), the 
following steps are taken :
+ * (1) We generate the data row key from the index row key, and check if the 
data row exists. If not, this unverified
+ * index row is skipped (i.e., not returned to the client), and it is deleted 
if it is old enough. The age check is
+ * necessary in order not to delete the index rows that are currently being 
updated. If the data row exists,
+ * we continue with the rest of the steps.
+ * (2) The index row is rebuilt from the data row.
+ * (3) The current scanner is closed as the newly rebuilt row will not be 
visible to the current scanner.
+ * (4) if the data row does not point back to the unverified index row (i.e., 
the index row key generated from the data
+ * row does not match with the row key of the unverified index row), this 
unverified row is skipped and and it is
+ * deleted if it is old enough. A new scanner is opened starting form the 
index row after this unverified index row.
+ * (5) if the data points back to the unverified index row then, a new scanner 
is opened starting form the index row.
+ * The next row is scanned to check if it is verified. if it is verified, it 
is returned to the client. If not, then
+ * it means the data table row timestamp is lower than than the timestamp of 
the unverified index row, and
+ * the index row that has been rebuilt from the data table row is masked by 
this unverified row. This happens if the
+ * first phase updates (i.e., unverified index row updates) complete but the 
second phase updates (i.e., data table
+ * row updates) fail. There could be back to back such events so we need to 
scan older versions to retrieve
+ * the verified version that is masked by the unverified version(s).
+ *
  */
 public class GlobalIndexChecker implements RegionCoprocessor, RegionObserver {
     private static final Log LOG = LogFactory.getLog(GlobalIndexChecker.class);
     private GlobalIndexCheckerSource metricsSource;
+    public static final int NO_DATA_ROW = 0;
 
 Review comment:
   Done

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