diff --git hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java index 82cf976..e0e3e6c 100644 --- hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java +++ hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java @@ -260,6 +260,12 @@ public final class HConstants { public static final String HREGION_MEMSTORE_FLUSH_SIZE = "hbase.hregion.memstore.flush.size"; + public static final String HREGION_EDITS_REPLAY_SKIP_ERRORS = + "hbase.hregion.edits.replay.skip.errors"; + + public static final boolean DEFAULT_HREGION_EDITS_REPLAY_SKIP_ERRORS = + false; + /** Default size of a reservation block */ public static final int DEFAULT_SIZE_RESERVATION_BLOCK = 1024 * 1024 * 5; diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java index eb6d6d4..41009c3 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java @@ -2839,10 +2839,19 @@ public class HRegion implements HeapSize { // , Writable{ try { seqid = replayRecoveredEdits(edits, maxSeqIdInStores, reporter); } catch (IOException e) { - boolean skipErrors = conf.getBoolean("hbase.skip.errors", false); + boolean skipErrors = conf.getBoolean( + HConstants.HREGION_EDITS_REPLAY_SKIP_ERRORS, + conf.getBoolean( + "hbase.skip.errors", + HConstants.DEFAULT_HREGION_EDITS_REPLAY_SKIP_ERRORS)); + if (conf.get("hbase.skip.errors") != null) { + LOG.warn( + "The property 'hbase.skip.errors' has been deprecated. Please use " + + HConstants.HREGION_EDITS_REPLAY_SKIP_ERRORS + " instead."); + } if (skipErrors) { Path p = HLog.moveAsideBadEditsFile(fs, edits); - LOG.error("hbase.skip.errors=true so continuing. Renamed " + edits + + LOG.error(HConstants.HREGION_EDITS_REPLAY_SKIP_ERRORS"=true so continuing. Renamed " + edits + " as " + p, e); } else { throw e;