Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-27046

The filenum in AbstractFSWAL should be monotone increasing

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.5.0, 3.0.0-alpha-3, 2.4.13
    • None
    • None
    • Reviewed

    Description

      This is the current 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;
        }
      

      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.

      Attachments

        Issue Links

          Activity

            People

              zhangduo Duo Zhang
              zhangduo Duo Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: