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


##########
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:
   At this time there are cases when the WALFile will still be open. In current 
code we recoverLease at RS once master assign the splitting to the worker RS. 
@Apache9 do you think we should move the recoverLease to Master ? 
   
   Before this rename we also rename the WALdirectory for the rs. @jojochuang 
is renaming directory is different from file renaming ? If directory rename is 
also not supported when some file inside the directory is open then we need 
changes in current code as well. 



-- 
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