-
Notifications
You must be signed in to change notification settings - Fork 964
fix pendingDeletedLedgers do not remove ledger error #4525
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
Conversation
| 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
hezhangjian
left a comment
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 |
StevenLuMT
left a comment
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.
Good jobs
Checkstyle fail,please update @TakaHiR07
|
43730af to
4614641
Compare
* fix pendingDeletedLedgers not remove ledger (cherry picked from commit 0df3caf)
* fix pendingDeletedLedgers not remove ledger (cherry picked from commit 0df3caf)
* fix pendingDeletedLedgers not remove ledger (cherry picked from commit 0df3caf)
* fix pendingDeletedLedgers not remove ledger (cherry picked from commit 0df3caf)

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.