HBASE-21721 FSHLog : reduce write#syncs() times (#2217)

Signed-off-by: stack <stack@apache.org>
Signed-off-by: Anoop <anoopsamjohn@apache.org>
This commit is contained in:
Bo Cui 2020-08-08 12:09:48 +08:00 committed by Anoop Sam John
parent 303db63b76
commit 11cfb0f382
1 changed files with 4 additions and 0 deletions

View File

@ -636,8 +636,12 @@ public class FSHLog extends AbstractFSWAL<Writer> {
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);