From 24ea9d1e48860f9305309a26ada73d515256f7c7 Mon Sep 17 00:00:00 2001 From: Ashish Singhi Date: Tue, 13 Mar 2018 15:31:39 +0530 Subject: [PATCH] HBASE-20146 Addendum Regions are stuck while opening when WAL is disabled Signed-off-by: zhangduo Signed-off-by: Chia-Ping Tsai --- .../org/apache/hadoop/hbase/wal/DisabledWALProvider.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/DisabledWALProvider.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/DisabledWALProvider.java index f858054135a..75439fe6c52 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/DisabledWALProvider.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/DisabledWALProvider.java @@ -32,6 +32,7 @@ import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.PrivateCellUtil; import org.apache.hadoop.hbase.client.RegionInfo; +import org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl.WriteEntry; import org.apache.hadoop.hbase.regionserver.wal.WALActionsListener; import org.apache.hadoop.hbase.regionserver.wal.WALCoprocessorHost; import org.apache.hadoop.hbase.util.FSUtils; @@ -162,7 +163,13 @@ class DisabledWALProvider implements WALProvider { @Override public long append(RegionInfo info, WALKeyImpl key, WALEdit edits, boolean inMemstore) throws IOException { - key.setWriteEntry(key.getMvcc().begin()); + WriteEntry writeEntry = key.getMvcc().begin(); + if (!edits.isReplay()) { + for (Cell cell : edits.getCells()) { + PrivateCellUtil.setSequenceId(cell, writeEntry.getWriteNumber()); + } + } + key.setWriteEntry(writeEntry); if (!this.listeners.isEmpty()) { final long start = System.nanoTime(); long len = 0;