Fix race condition.
Motivation
fixes-#3362
Nice catch!
Please add more details about how the race condition happened.
see #3362, update the detail info
Overall look good to me. Could you please add a unit test to cover this?
fine.
I left couple of comments to address.
As for the original issue, is this a theoretical find or from a production case? Most of the ledger-specific mutations in BK happen in the ordered executor where the ledgerid is used as a key, so the mutations should happen on the same thread sequentially.
This is not real case, just for analyze. We can't ensure the user open ledger and close ledger in same thread, so if you want to process register and unregister serially, should handle it in AbstractZkLedgerManageer, not outside by invoke user.
fix old workflow,please see #3455 for detail
rerun failure checks
Close this since it is open for a long time without any updates. Feel free to reopen it if you want to continue