Skip to content

Commit f580485

Browse files
cuibo01Reidddddd
authored andcommitted
HBASE-21721 reduce write#syncs() times (apache#2220)
Signed-off-by: Anoop <anoopsamjohn@apache.org> Signed-off-by: stack <stack@apache.org>
1 parent 3a6de20 commit f580485

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ public Path getCurrentFileName() {
10061006
public long getFilenum() {
10071007
return filenum.get();
10081008
}
1009-
1009+
10101010
@Override
10111011
public String toString() {
10121012
return "FSHLog " + logFilePrefix + ":" + logFileSuffix + "(num " + filenum + ")";
@@ -1283,8 +1283,12 @@ public void run() {
12831283
Throwable lastException = null;
12841284
try {
12851285
Trace.addTimelineAnnotation("syncing writer");
1286+
long unSyncedFlushSeq = highestUnsyncedSequence;
12861287
writer.sync();
12871288
Trace.addTimelineAnnotation("writer synced");
1289+
if (unSyncedFlushSeq > currentSequence) {
1290+
currentSequence = unSyncedFlushSeq;
1291+
}
12881292
currentSequence = updateHighestSyncedSequence(currentSequence);
12891293
} catch (IOException e) {
12901294
LOG.error("Error syncing, request close of WAL", e);

0 commit comments

Comments
 (0)