From 11cfb0f38290be2cdbca5b0b74fbcbb1af3be15c Mon Sep 17 00:00:00 2001 From: Bo Cui Date: Sat, 8 Aug 2020 12:09:48 +0800 Subject: [PATCH] HBASE-21721 FSHLog : reduce write#syncs() times (#2217) Signed-off-by: stack Signed-off-by: Anoop --- .../java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java | 4 ++++ 1 file changed, 4 insertions(+) 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 8fb8e83e00f..fb2abfaa45e 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 @@ -636,8 +636,12 @@ public class FSHLog extends AbstractFSWAL { Throwable lastException = null; try { TraceUtil.addTimelineAnnotation("syncing writer"); + long unSyncedFlushSeq = highestUnsyncedTxid; writer.sync(sf.isForceSync()); TraceUtil.addTimelineAnnotation("writer synced"); + if (unSyncedFlushSeq > currentSequence) { + currentSequence = unSyncedFlushSeq; + } currentSequence = updateHighestSyncedSequence(currentSequence); } catch (IOException e) { LOG.error("Error syncing, request close of WAL", e);