EungsopYoo commented on code in PR #6974:
URL: https://github.com/apache/hbase/pull/6974#discussion_r2101306196
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStoreFile.java:
##########
@@ -514,18 +514,23 @@ private void open() throws IOException {
comparator = initialReader.getComparator();
}
+ public void initReader() throws IOException {
+ initReader(false);
+ }
+
/**
* Initialize the reader used for pread.
*/
- public void initReader() throws IOException {
- if (initialReader == null) {
+ public void initReader(boolean reopen) throws IOException {
+ if (initialReader == null || reopen) {
synchronized (this) {
- if (initialReader == null) {
+ if (initialReader == null || reopen) {
+ boolean evictOnClose = cacheConf == null ||
cacheConf.shouldEvictOnClose();
Review Comment:
To reuse `evictOnClose` in line 530 and 534.
https://github.com/apache/hbase/pull/6974/files#diff-e62a0bd3a3d8ca0c5cac5cf21711a77fb1c3bec947a32c1645cd8dce3068f2a9R530
https://github.com/apache/hbase/pull/6974/files#diff-e62a0bd3a3d8ca0c5cac5cf21711a77fb1c3bec947a32c1645cd8dce3068f2a9R534
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java:
##########
@@ -255,18 +255,14 @@ public StoreScanner(HStore store, ScanInfo scanInfo, Scan
scan, NavigableSet<byt
List<KeyValueScanner> scanners = null;
try {
- // Pass columns to try to filter out unnecessary StoreFiles.
- scanners = selectScannersFrom(store,
- store.getScanners(cacheBlocks, scanUsePread, false, matcher,
scan.getStartRow(),
- scan.includeStartRow(), scan.getStopRow(), scan.includeStopRow(),
this.readPt,
- isOnlyLatestVersionScan(scan)));
-
- // Seek all scanners to the start of the Row (or if the exact matching
row
- // key does not exist, then to the start of the next matching Row).
- // Always check bloom filter to optimize the top row seek for delete
- // family marker.
- seekScanners(scanners, matcher.getStartKey(), explicitColumnQuery &&
lazySeekEnabledGlobally,
- parallelSeekEnabled);
+ try {
+ scanners = getScannersAndSeek(false);
+ } catch (IOException e) {
+ // If we fail to read the store files,
+ // we should close and reopen the store file readers to refresh
metadata
+ LOG.info("Reopen StoreScanner", e);
+ scanners = getScannersAndSeek(true);
Review Comment:
This is the only retry mechanism triggered upon failure, so it occurs only
under rare conditions. Therefore, I believe it's acceptable to retry on all
types of IOException.
However, StoreFileScanner throws IOExceptions with messages that are
prefixed with "Could not". So we could use this pattern to decide when to
retry. Nevertheless, since these messages may change over time, this approach
could become unreliable.
https://github.com/apache/hbase/blob/40b274dee7f49b4dac9df705dfb7267460454ebb/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java#L220
https://github.com/apache/hbase/blob/40b274dee7f49b4dac9df705dfb7267460454ebb/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java#L250
https://github.com/apache/hbase/blob/40b274dee7f49b4dac9df705dfb7267460454ebb/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java#L278
https://github.com/apache/hbase/blob/40b274dee7f49b4dac9df705dfb7267460454ebb/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileScanner.java#L518
--
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]