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

fix: deleted ledgers are not removed from the cache #137

Merged
merged 4 commits into from
Apr 30, 2024

Conversation

nicoloboschi
Copy link
Contributor

In production clusters using Pulsar we noticed deleted ledgers are not removed from the cache.

Fixes:

  • Clear all ledgers during the refresh
  • Update lombok and surefire to run tests with JDK21

@@ -283,12 +283,11 @@ public void doRefreshMetadataCache() {
}

Iterable<Long> ledgersIds = bkAdmin.listLedgers();
metadataCache.clearLedgers(clusterId);
Copy link
Contributor

Choose a reason for hiding this comment

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

I see 2 problems here:

  1. if something goes wrong in the loop the database will be empty
  2. if you have many ledgers for some time the users will see less data than expected (wrong results in the queries)

why do we have do it this way ?

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.

LGTM

@nicoloboschi nicoloboschi merged commit 4d02c27 into master Apr 30, 2024
1 check passed
@nicoloboschi nicoloboschi deleted the fix-ledgers-deletion branch April 30, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants