Skip to content

Unnecessary contention on "metadataLock" in LedgerHandle while appending from different threads #4517

Open
@eolivelli

Description

@eolivelli

BUG REPORT

Describe the bug

Appening to a ledger from different threads leads to high contention on the metadataLock object

image

I suggest to switch to some form for ReentrantReadWriteLock and distinguish the cases in which there is only readOnly access to the critical sections guarded by the lock, especially on the happy paths (no bookies failures)

To Reproduce

I cannot share my reprorucer but the flame graph is pretty clear.

Expected behavior

Happending to a Ledger from multipple threads should lead to less contention.

Additional context

Using latest BK client 4.17.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions