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 9a4887da4ea..65bac01ba87 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 @@ -594,9 +594,11 @@ public class FSHLog extends AbstractFSWAL { long start = System.nanoTime(); Throwable lastException = null; try { - TraceUtil.addTimelineAnnotation("syncing writer"); - writer.sync(sf.isForceSync()); - TraceUtil.addTimelineAnnotation("writer synced"); + if(writer != null) { + TraceUtil.addTimelineAnnotation("syncing writer"); + writer.sync(sf.isForceSync()); + TraceUtil.addTimelineAnnotation("writer synced"); + } currentSequence = updateHighestSyncedSequence(currentSequence); } catch (IOException e) { LOG.error("Error syncing, request close of WAL", e);