File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,13 @@ private void dequeueCurrentLog() throws IOException {
258
258
private boolean readNextEntryAndRecordReaderPosition () throws IOException {
259
259
Entry readEntry = reader .next ();
260
260
long readerPos = reader .getPosition ();
261
- OptionalLong fileLength = walFileLengthProvider .getLogFileSizeIfBeingWritten (currentPath );
261
+ OptionalLong fileLength ;
262
+ if (logQueue .getQueueSize (walGroupId ) > 1 ) {
263
+ fileLength = OptionalLong .empty ();
264
+ } else {
265
+ // if there is only one file in queue, check whether it is still being written to
266
+ fileLength = walFileLengthProvider .getLogFileSizeIfBeingWritten (currentPath );
267
+ }
262
268
if (fileLength .isPresent () && readerPos > fileLength .getAsLong ()) {
263
269
// See HBASE-14004, for AsyncFSWAL which uses fan-out, it is possible that we read uncommitted
264
270
// data, so we need to make sure that we do not read beyond the committed file length.
You can’t perform that action at this time.
0 commit comments