apache / apache/bookkeeper

SynThread checkpoint occurs IllegalReferenceCountException when change entryLogPerLedgerEnabled property

Open
#3,953 0 comments 0 reactions 0 assignees View on GitHub
type/bug
Dominant language
Java
Stars
2k
Forks
976
Avg merge
6d 15h
Merged PRs (30d)
7

Description

**BUG REPORT**

We have a bookie node which having run a period of time, and it runs with entryLogPerLedgerEnabled is false as default, Recently we change this property to true, unfortunately the program occurs exception as below

image

Steps to reproduce the behavior:
1. Startup a new bookie node, and the related properties as below:
ledgerStorageClass=org.apache.bookkeeper.bookie.SortedLedgerStorage
entryLogPerLedgerEnabled=false
2. Running this bookie after some time, change entryLogPerLedgerEnabled is true, reboot the bookie node.
3. The program throw IllegalReferenceCountException
4. System.exit(5)

***Expected behavior***

The bookie support switch entrylogPerLedgerEnabled normally.

***Additional context***

We review the code and find the Entrylogger#flush method will be triggered when GarbageCollectorThread doing compact entrylogs, which will make race condition with syncthread#checkpoint at flushRotatedLogs point, However, the flushRotatedLogs method in EntryLogManagerForEntryLogPerLedger is not protected by synchonzied,hence BufferedLogChannel#close throw IllegalReferenceCountException since a concurrency scenario.

Bookkeeper version : 4.15.0

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.