apache / apache/bookkeeper

shouldCreateNewEntryLog flag variable (in EntryLogger/EntryLogManager) should be dealt correctly in the case of diskFull / diskAlmostFull cases

Open
#1,347 0 comments 0 reactions 0 assignees View on GitHub
area/bookie triage/week-33 type/bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.