Skip to content

Commit

Permalink
[fix] [ml] The atomicity of multiple fields of ml is broken (apache#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode authored Jan 29, 2023
1 parent 8ea41f1 commit e2851da
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1554,16 +1554,16 @@ public void operationComplete(Void v, Stat stat) {
log.debug("[{}] Updating of ledgers list after create complete. version={}", name, stat);
}
ledgersStat = stat;
ledgers.put(lh.getId(), newLedger);
currentLedger = lh;
currentLedgerEntries = 0;
currentLedgerSize = 0;
metadataMutex.unlock();
updateLedgersIdsComplete();
synchronized (ManagedLedgerImpl.this) {
ledgers.put(lh.getId(), newLedger);
currentLedger = lh;
currentLedgerEntries = 0;
currentLedgerSize = 0;
updateLedgersIdsComplete();
mbean.addLedgerSwitchLatencySample(System.currentTimeMillis()
- lastLedgerCreationInitiationTimestamp, TimeUnit.MILLISECONDS);
}
metadataMutex.unlock();

// May need to update the cursor position
maybeUpdateCursorBeforeTrimmingConsumedLedger();
Expand Down

0 comments on commit e2851da

Please sign in to comment.