jojochuang commented on code in PR #6534:
URL: https://github.com/apache/hbase/pull/6534#discussion_r1900248008


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/SplitWALManager.java:
##########
@@ -184,4 +184,30 @@ public void releaseSplitWALWorker(ServerName worker, 
MasterProcedureScheduler sc
   public void addUsedSplitWALWorker(ServerName worker) {
     splitWorkerAssigner.addUsedWorker(worker);
   }
+
+  /**
+   * Rename the WAL file at the specified walPath to retry with another 
worker. Returns true if the
+   * file is successfully renamed, or if it has already been renamed in 
previous try. Returns false
+   * if neither of the files exists. It throws an IOException if got any error 
while renaming. This
+   * method is only called in case of failure on one worker so in case of no 
failure flow is same as
+   * old one.
+   */
+  public boolean ifExistRenameWALForRetry(String walPath, String 
postRenameWalPath)
+    throws IOException {
+    if (fs.exists(new Path(rootDir, walPath))) {
+      if (!fs.rename(new Path(rootDir, walPath), new Path(rootDir, 
postRenameWalPath))) {

Review Comment:
   Hi, I'm not terribly familiar with wal split.
   Does the WAL file get closed by this time? I'm asking because Ozone doesn't 
yet support renaming open files. And supporting that is quite a big project 
itself.
   
   Even thought that's not yet a huge problem for HBase since HBase isn't 
default to run on Ozone, it would be great if we don't attempt to rename open 
files.
   
   Thanks!



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to