Duo Zhang created HBASE-30255:
---------------------------------

             Summary: Async archiving wal file causes TestLogRolling flaky
                 Key: HBASE-30255
                 URL: https://issues.apache.org/jira/browse/HBASE-30255
             Project: HBase
          Issue Type: Sub-task
          Components: test, wal
            Reporter: Duo Zhang


{code}
    if (logsToArchive != null) {
      final List<Pair<Path, Long>> localLogsToArchive = logsToArchive;
      // make it async
      for (Pair<Path, Long> log : localLogsToArchive) {
        logArchiveExecutor.execute(() -> {
          archive(log);
        });
        this.walFile2Props.remove(log.getFirst());
      }
    }
{code}

Here we will use a logArchiveExecutor to archive the wal file, and in the 
archive method we will decrease the log file size, but the removal from 
walFile2Props is done in foreground, so the assertion in TestLogRolling is flaky

{code}
    // should have deleted all the rolled wal files
    TEST_UTIL.waitFor(5000, () -> 
AbstractFSWALProvider.getNumRolledLogFiles(log) == 0);
    assertEquals(0, AbstractFSWALProvider.getLogFileSize(log));
{code}

As when num rolled fles reaches zero, the log file size may not be decreased 
yet.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to