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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to