Apache9 commented on code in PR #7075:
URL: https://github.com/apache/hbase/pull/7075#discussion_r2206211481


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/wal/AbstractRecoveredEditsOutputSink.java:
##########
@@ -111,6 +128,11 @@ protected Path 
closeRecoveredEditsWriterAndFinalizeEdits(RecoveredEditsWriter ed
       // TestHLogSplit#testThreading is an example.
       if (walSplitter.walFS.exists(editsWriter.path)) {
         if (!walSplitter.walFS.rename(editsWriter.path, dst)) {
+          // We only rename editsWriter if dst does not exist, still if rename 
fails and dst exist
+          // with equal or more entries, we can delete the editsWriter file.
+          // It happens if two RS was splitting the same WAL and both tried to 
rename at the same
+          // time. See HBASE-28951 for more details.
+          if (deleteTmpIfDstHasNoLessEntries(editsWriter, dst)) return dst;

Review Comment:
   Do we still need to above deleteOneWithFewerEntries call? And please use 
'{}' here to avoid a checkstyle warning.



-- 
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-unsubscr...@hbase.apache.org

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

Reply via email to