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


##########
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:
   As recoverLease doesn't support the directory path 
(https://github.com/apache/hadoop/blob/fb1bb6429dfb4e45687e0bc507c5a2ed26bd0bb0/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/leaserecoverable.md),
 so we need to recoverlease for each file. We also have to recoverLease before 
renaming the walFile. 
   
   Btw at least for hadoop I think that both (recoverLease after rename or 
before rename) are fine. As renaming is a metadata operation and data is linked 
to INodes.  



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