HBASE-21721 reduce write#syncs() times (#2220)

Signed-off-by: Anoop <anoopsamjohn@apache.org>
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
Bo Cui 2020-08-10 20:43:14 +08:00 committed by GitHub
parent 839ce8e560
commit 57e4144ddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1317,8 +1317,12 @@ public class FSHLog implements WAL {
Throwable lastException = null;
try {
Trace.addTimelineAnnotation("syncing writer");
long unSyncedFlushSeq = highestUnsyncedSequence;
writer.sync(takeSyncFuture.isForceSync());
Trace.addTimelineAnnotation("writer synced");
if (unSyncedFlushSeq > currentSequence) {
currentSequence = unSyncedFlushSeq;
}
currentSequence = updateHighestSyncedSequence(currentSequence);
} catch (IOException e) {
LOG.error("Error syncing, request close of WAL", e);