poorbarcode commented on code in PR #4462:
URL: https://github.com/apache/bookkeeper/pull/4462#discussion_r1732104624
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/HandleFactoryImpl.java:
##########
@@ -21,14 +21,25 @@
package org.apache.bookkeeper.bookie;
+import com.google.common.cache.Cache;
+import com.google.common.cache.CacheBuilder;
import java.io.IOException;
+import java.time.Duration;
import org.apache.bookkeeper.bookie.LedgerStorage.LedgerDeletionListener;
import org.apache.bookkeeper.util.collections.ConcurrentLongHashMap;
class HandleFactoryImpl implements HandleFactory, LedgerDeletionListener {
private final ConcurrentLongHashMap<LedgerDescriptor> ledgers;
private final ConcurrentLongHashMap<LedgerDescriptor> readOnlyLedgers;
+ /**
+ * Once the ledger was marked "fenced" before, the ledger was accessed by
multi clients. One client is calling
+ * "delete" now, and other clients may call "write" continuously later. We
mark these ledgers can not be written
+ * anymore. And maintains the state for 7 days is safety.
+ */
+ private final Cache<Long, Boolean> recentlyFencedAndDeletedLedgers =
CacheBuilder.newBuilder()
Review Comment:
@eolivelli How about we split this into 2 PRs
- Fix it in memory, which is what the current PR did. And this PR can be
cherry-picked into the previous branches, this fix can fix almost all the
scenarios(the probably of brokers and Bks crashes at the same time is quite few)
- Fix it with persistent storage, we can persist the states into a file, and
add a config to define which file will be used, this will be released with the
next feature release
--
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]