Skip to content

Commit

Permalink
HBASE-28184 Tailing the WAL is very slow if there are multiple peers (#…
Browse files Browse the repository at this point in the history
…5505)

(cherry picked from commit d383f09)
  • Loading branch information
shahrs87 committed Nov 7, 2023
1 parent e6f269b commit 4227452
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,13 @@ private void dequeueCurrentLog() throws IOException {
private boolean readNextEntryAndRecordReaderPosition() throws IOException {
Entry readEntry = reader.next();
long readerPos = reader.getPosition();
OptionalLong fileLength = walFileLengthProvider.getLogFileSizeIfBeingWritten(currentPath);
OptionalLong fileLength;
if (logQueue.getQueueSize(walGroupId) > 1) {
fileLength = OptionalLong.empty();
} else {
// if there is only one file in queue, check whether it is still being written to
fileLength = walFileLengthProvider.getLogFileSizeIfBeingWritten(currentPath);
}
if (fileLength.isPresent() && readerPos > fileLength.getAsLong()) {
// See HBASE-14004, for AsyncFSWAL which uses fan-out, it is possible that we read uncommitted
// data, so we need to make sure that we do not read beyond the committed file length.
Expand Down

0 comments on commit 4227452

Please sign in to comment.