kadirozde commented on a change in pull request #592: PHOENIX-5505 Index read
repair does not repair unverified rows with h…
URL: https://github.com/apache/phoenix/pull/592#discussion_r331263043
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/index/GlobalIndexChecker.java
##########
@@ -247,9 +255,12 @@ private void repairIndexRows(byte[] indexRowKey, long ts,
List<Cell> row) throws
buildIndexScan.setAttribute(BaseScannerRegionObserver.SKIP_REGION_BOUNDARY_CHECK,
Bytes.toBytes(true));
}
// Rebuild the index rows from the corresponding the rows in the
the data table
+ // Get the data row key from the index row key
byte[] dataRowKey = indexMaintainer.buildDataRowKey(new
ImmutableBytesWritable(indexRowKey), viewConstants);
+ // Rebuild the index rows from the data rows starting with the
data row key
buildIndexScan.withStartRow(dataRowKey, true);
- buildIndexScan.setTimeRange(ts, maxTimestamp);
+ buildIndexScan.setTimeRange(0, maxTimestamp);
Review comment:
There is no reason to that. If we do that we would rebuild rows
unnecessarily. Assume that there are N overwrite attempts on a particular row
and all of them failed at phase 2 except the last overwrite. Also assume that
just before the successful one, a client scans the index table. This scan will
see the index row is unverified and will rebuilt the older version and will get
the older successful version (not the last successful version), which is
correct behavior. If we do not honor maxTimestamp then we would build both the
old and new version but return to the client old version. In other words, we
unnecessarily would build the newer versions even though they may not need to
be rebuilt.
----------------------------------------------------------------
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