shouldCreateNewEntryLog flag variable (in EntryLogger/EntryLogManager) should be dealt correctly in the case of diskFull / diskAlmostFull cases
- Dominant language
- Java
- Stars
- 2k
- Forks
- 976
- Avg merge
- 6d 15h
- Merged PRs (30d)
- 7
Description
**BUG REPORT**
1. Please describe the issue you observed:
In EntryLogger/EntryLogManager, LedgerDirsListener controls the flag - 'shouldCreateNewEntryLog' variable, which decides whether to create a log in the addEntry call. But it is not completely correct to set shouldCreateNewEntryLog to true in all the cases of diskFull and diskAlmostFull
1) I don't think it is appropriate to createNewLog in the case of "diskAlmostFull", because though disk is almost full, it is still in writableLedgerDirectories and it can be the candidate for hosting the next new entrylog. So it makes no sense to rotate current activelog and create new log in the same directory.
2) For the same logic when this ‘currentDir’ and all ledgerdirs are full, it doesn't make sense to create newlog. Since for the creation of new entrylog when all ledgerdirs are full, it would use “getDirsAboveUsableThresholdSize(minUsableSizeForEntryLogCreation, true)” (getWritableLedgerDirsForNewLog()) and again this ‘currentDir’ could become candidate for creation of new entrylog. Also, If allDisks are full then proceed with the current logChannel, since Bookie must have turned to readonly mode and the addEntry traffic would be from GC and it is ok to proceed in this case.
Contributor guide
Assessment
This issue has not been assessed yet.