From 72932ad0df32859c9492b8f313c4a79a7e85bfd0 Mon Sep 17 00:00:00 2001 From: Gaurav Kanade Date: Thu, 23 Jul 2020 10:25:33 +0530 Subject: [PATCH] null check for writer if not initialized yet during syncrunner run --- .../org/apache/hadoop/hbase/regionserver/wal/FSHLog.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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);