Apache9 commented on code in PR #6534:
URL: https://github.com/apache/hbase/pull/6534#discussion_r1905524741
##########
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:
I think this should have been done before we rename the wal directory?
--
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]