You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/06/02 13:44:06 UTC

[GitHub] [hbase] Zooooey commented on a diff in pull request #4449: HBASE-27046 The filenum in AbstractFSWAL should be monotone increasing

Zooooey commented on code in PR #4449:
URL: https://github.com/apache/hbase/pull/4449#discussion_r887969046


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.java:
##########
@@ -630,12 +630,8 @@ public Path getCurrentFileName() {
    * retrieve the next path to use for writing. Increments the internal filenum.
    */
   private Path getNewPath() throws IOException {
-    this.filenum.set(EnvironmentEdgeManager.currentTime());
+    this.filenum.set(Math.max(getFilenum() + 1, EnvironmentEdgeManager.currentTime()));
     Path newPath = getCurrentFileName();
-    while (fs.exists(newPath)) {

Review Comment:
   Why remove this while loop? I guess this while loop can make the code more robust.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org