diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java index 276902e4de1d..63f4029b1f60 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java @@ -329,7 +329,7 @@ protected void doReplaceWriter(Path oldPath, Path newPath, Writer nextWriter) th SyncFuture syncFuture = null; SafePointZigZagLatch zigzagLatch = null; long sequence = -1L; - if (this.ringBufferEventHandler != null) { + if (this.writer != null && this.ringBufferEventHandler != null) { // Get sequence first to avoid dead lock when ring buffer is full // Considering below sequence // 1. replaceWriter is called and zigzagLatch is initialized