Affects Version/s: None
Fix Version/s: None
TestHLogMethods#testGetSplitEditFilesSorted tests the ordering of split edit files. However, we should have a test covering more realistic scenario.
Suppose there are two split edit files for one region.
Their edits are as the following
edit id 1001
edit id 1002
edit id 1003
edit id 2001
edit id 2002
edit id 2003
As the current logic, file 1 is named "1003" and file 2 is named "2003".
Suppose region's seq id is 1000 before replaying edits files.
So we will replay all the edits in File 1 and File 2
However, if we replay File 2 first, the following case could result in data loss:
1.Completing File 2 replay.
2.Do the internalFlushcache. See HRegion#replayRecoveredEdits:
if (flush) internalFlushcache(null, currentEditSeqId, status);
3.the regionserver crashes
4.Region is assigned to another server, and its seq ID becomes 2003
5.File1 will be skipped when replaying edits