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_r330821821
##########
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:
The min and max timestamp are from the original scan on the index (set by
the client). I did not want to honor the minTimestamp to cover one case. Assume
that there are bunch of overwrites on the same row that made only to the index
table within min and max timestamps. If we build index table using
[minTimestamp, maxTimestamp], then the data table row will not be visible to
buildIndexScan. Also assume that the compaction process has removed the good
version of this index row (i.e., verified version). If so, we may end up
deleting all the versions of the index row (if we start from minTimestamp). I
think Phoenix client will always set minTimestamp to zero or table create
timestamp but I want to be on the safe side.
----------------------------------------------------------------
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