void-ptr974 commented on code in PR #25795:
URL: https://github.com/apache/pulsar/pull/25795#discussion_r3308019160
##########
managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java:
##########
@@ -1749,8 +1767,11 @@ public void operationComplete(Void v, Stat stat) {
synchronized (ManagedLedgerImpl.this) {
try {
State state =
STATE_UPDATER.get(ManagedLedgerImpl.this);
- if (state == State.Closed || state.isFenced()) {
- log.debug().log("skip ledger update after
create complete ledger is closed or fenced");
+ if (state == State.Closed || state ==
State.Terminated || state.isFenced()) {
Review Comment:
Thanks for the detailed explanation. I’ve also identified this remaining
terminate-vs-rollover metadata race.
The ManagedLedger code path is quite complex, so I think it would be
clearer
and safer to split the related fixes into smaller PRs instead of carrying
all
of them in this one. This PR focuses on the terminated-state transition and
pending-add handling.
After this PR is merged, I’ll submit a follow-up PR to address the metadata
update race, including the stale rollover success path, the BadVersion
path,
and cleanup of any unused ledger that may have been written to metadata.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]