hangc0276 commented on code in PR #4462:
URL: https://github.com/apache/bookkeeper/pull/4462#discussion_r1668862868
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/HandleFactoryImpl.java:
##########
@@ -64,8 +79,22 @@ public LedgerDescriptor getReadOnlyHandle(final long
ledgerId) throws IOExceptio
return handle;
}
+ private void markIfConflictWritingOccurs(long ledgerId) {
+ LedgerDescriptor ledgerDescriptor = ledgers.get(ledgerId);
+ try {
+ if (ledgerDescriptor != null && ledgerDescriptor.isFenced()) {
+ recentlyFencedAndDeletedLedgers.put(ledgerId, true);
+ }
+ } catch (IOException | BookieException ex) {
+ // The ledger is in limbo state.
+ recentlyFencedAndDeletedLedgers.put(ledgerId, true);
+ }
+ }
+
@Override
public void ledgerDeleted(long ledgerId) {
+ markIfConflictWritingOccurs(ledgerId);
Review Comment:
It depends on the garbage collection triggered. If the gc is not triggered,
we also should fail the case, because the ledger metadata has already been
deleted, correct?
--
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]