You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2021/10/17 08:30:55 UTC
[GitHub] [bookkeeper] eolivelli commented on a change in pull request #2833: Eliminate direct ZK access in ScanAndCompareGarbageCollector
eolivelli commented on a change in pull request #2833:
URL: https://github.com/apache/bookkeeper/pull/2833#discussion_r730376668
##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/meta/ZkLedgerUnderreplicationManager.java
##########
@@ -786,13 +789,14 @@ public static void acquireUnderreplicatedLedgerLock(ZooKeeper zkc, String zkLedg
LOCK_DATA, zkAcls, CreateMode.EPHEMERAL);
}
- /**
- * Release the underreplicated ledger lock if it exists.
- */
- public static void releaseUnderreplicatedLedgerLock(ZooKeeper zkc, String zkLedgersRootPath, long ledgerId)
- throws InterruptedException, KeeperException {
- if (isLedgerBeingReplicated(zkc, zkLedgersRootPath, ledgerId)) {
- zkc.delete(getUrLedgerLockZnode(getUrLockPath(zkLedgersRootPath), ledgerId), -1);
+ @Override
+ public void acquireUnderreplicatedLedger(long ledgerId)
+ throws ReplicationException {
+ try {
+ acquireUnderreplicatedLedgerLock(zkc, getUrLedgerLockZnode(urLockPath, ledgerId), ledgerId,
+ ZkUtils.getACLs(conf));
+ } catch (Exception e) {
+ throw new ReplicationException.UnavailableException("Failed to acquire underreplicated ledger lock", e);
Review comment:
What about reporting the ledgerId?
##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/ScanAndCompareGarbageCollector.java
##########
@@ -291,4 +283,22 @@ public void gc(GarbageCleaner garbageCleaner) {
bkActiveledgers.removeAll(overReplicatedLedgers);
return overReplicatedLedgers;
}
+
Review comment:
Static?
--
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: issues-unsubscribe@bookkeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org