You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Duo Zhang (Jira)" <ji...@apache.org> on 2022/05/17 04:50:00 UTC

[jira] [Created] (HBASE-27046) The filenum in AbstractFSWAL should be monotone increasing

Duo Zhang created HBASE-27046:
---------------------------------

             Summary: The filenum in AbstractFSWAL should be monotone increasing
                 Key: HBASE-27046
                 URL: https://issues.apache.org/jira/browse/HBASE-27046
             Project: HBase
          Issue Type: Improvement
            Reporter: Duo Zhang


This is the current code

{code}
  /**
   * retrieve the next path to use for writing. Increments the internal filenum.
   */
  private Path getNewPath() throws IOException {
    this.filenum.set(EnvironmentEdgeManager.currentTime());
    Path newPath = getCurrentFileName();
    while (fs.exists(newPath)) {
      this.filenum.incrementAndGet();
      newPath = getCurrentFileName();
    }
    return newPath;
  }
{code}

In some tests, we inject our own EnvironmentEdge, it may return the same ts always or even go backwards, the logic here is not rnough to keep the filenum monotone increasing, as we may have already archive the old file.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)