@Override
  public long getSyncedLength() {
    /**
     * The statement "this.output = null;" in {@link AsyncProtobufLogWriter#close} is a sync point,
     * if output is null, then finalSyncedLength must set, so we can return finalSyncedLength, else
     * we return output.getSyncedLength
     */
    AsyncFSOutput outputToUse = this.output;
    if (outputToUse == null) {
      long finalSyncedLengthToUse = this.finalSyncedLength;
      assert finalSyncedLengthToUse >= 0;
      return finalSyncedLengthToUse;
    }
    return outputToUse.getSyncedLength();
  }
We have to call {@link AsyncFSOutput#getSyncedLength()} after {@link AsyncFSOutput#close()}
to get the final length synced to underlying filesystem because {@link AsyncFSOutput#close()}
may also flush some data to underlying filesystem.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AsyncProtobufLogWriter.java