Umeshkumar9414 commented on code in PR #7075: URL: https://github.com/apache/hbase/pull/7075#discussion_r2206236257
########## 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: Above deleteOneWithFewerEntries call is also handling a case when destination will have less enteries. I think we can keep that. ########## 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: Above deleteOneWithFewerEntries call is also handling a case when destination will have less enteries. I think we should keep that. -- 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