HBASE-26107 MOB compaction with missing files catches incorrect exception (#3511)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
Signed-off-by: Pankaj Kumar <pankajkumar@apache.org>
This commit is contained in:
Peter Somogyi 2021-07-22 10:16:03 +02:00 committed by GitHub
parent 9e27de6aed
commit 3c70bc1f31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -35,6 +35,7 @@ import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.PrivateCellUtil;
import org.apache.hadoop.hbase.TableName;
@ -371,12 +372,13 @@ public class DefaultMobStoreCompactor extends DefaultCompactor {
// Added to support migration
try {
mobCell = mobStore.resolve(c, true, false).getCell();
} catch (FileNotFoundException fnfe) {
if (discardMobMiss) {
} catch (DoNotRetryIOException e) {
if (discardMobMiss && e.getCause() != null
&& e.getCause() instanceof FileNotFoundException) {
LOG.error("Missing MOB cell: file={} not found cell={}", fName, c);
continue;
} else {
throw fnfe;
throw e;
}
}

View File

@ -32,6 +32,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.DoNotRetryIOException;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.PrivateCellUtil;
import org.apache.hadoop.hbase.TableName;
@ -192,12 +193,13 @@ public class FaultyMobStoreCompactor extends DefaultMobStoreCompactor {
// Added to support migration
try {
mobCell = mobStore.resolve(c, true, false).getCell();
} catch (FileNotFoundException fnfe) {
if (discardMobMiss) {
LOG.error("Missing MOB cell: file={} not found", fName);
} catch (DoNotRetryIOException e) {
if (discardMobMiss && e.getCause() != null
&& e.getCause() instanceof FileNotFoundException) {
LOG.error("Missing MOB cell: file={} not found cell={}", fName, c);
continue;
} else {
throw fnfe;
throw e;
}
}