-
Notifications
You must be signed in to change notification settings - Fork 904
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 pendingDeletedLedgers do not remove ledger error #4525
base: master
Are you sure you want to change the base?
fix pendingDeletedLedgers do not remove ledger error #4525
Conversation
@@ -345,6 +345,7 @@ public void removeDeletedLedgers() throws IOException { | |||
log.debug("Persisting deletes of ledgers {}", deletedLedgers); | |||
} | |||
|
|||
pendingDeletedLedgers.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your fix. But I think we should call pendingDeletedLedgers.remove(ledgerId)
after line342.
pendingDeletedLedgers
cloud being adding when call clear()
, cause some ledgers not have deleted from ledgersDB but clear from pendingDeletedLedgers
.
By the way. pendingDeletedLedgers
is a Sets.newConcurrentHashSet()
. I think it will not concurrent error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's ok
495513d
to
2fc7cf0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any chance we can add unit test for this?
you can see the new code |
Motivation
fix this pr #3989 cause ledger not remove in pendingDeletedLedgers.
Previous would do poll(), but later just do forEach()
Changes
keep the same logic before pr-3989.
Alternative fix is revert previous pr.