Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve] Optimize masterKeyCache StorageNotificationListener #3736

Merged

Conversation

wenbingshen
Copy link
Member

Motivation

Related to PR #3522, in order to implement masterKeyCache to clean up the deleted ledgerId, PR #3522 introduced LedgerStorageNotificationListener, which is used to monitor the cleanup action of calling back masterKeyCache when the ledger is deleted. I noticed that before this, LedgerStorage already has The purpose of the implementation of LedgerDeletionListener is to call back the corresponding user to do some cleaning operations after the ledger is deleted, which fully meets the requirements of LedgerStorageNotificationListener.

The function of the additionally introduced LedgerStorageNotificationListener is the same as that of LedgerDeletionListener, but a strange operation L is introduced in the GC thread: the GC thread needs to process a LedgerStorageNotificationListener notification, and the GC thread calls ledgerStorage.deleteLedger(ledgerId), and it will be executed LedgerDeletionListener notification again during the processing deleteLedger.

Changes

Replace LedgerStorageNotificationListener with existing LedgerDeletionListener to achieve this requirement.

@wenbingshen
Copy link
Member Author

@StevenLuMT @eolivelli PTAL. Thanks.

@wenbingshen
Copy link
Member Author

rerun failure checks

1 similar comment
@wenbingshen
Copy link
Member Author

rerun failure checks

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch !

very nice

@hangc0276 hangc0276 added this to the 4.16.0 milestone Jan 16, 2023
Copy link
Contributor

@StevenLuMT StevenLuMT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good work

@StevenLuMT StevenLuMT merged commit 700d45f into apache:master Feb 8, 2023
@wenbingshen wenbingshen deleted the wenbing/optimizeLedgerRemovedListener branch February 8, 2023 07:16
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants