You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/11/10 18:18:52 UTC

[GitHub] [hbase-filesystem] joshelser commented on a change in pull request #29: HBASE-26437 Clean up the znodes for the src after a rename.

joshelser commented on a change in pull request #29:
URL: https://github.com/apache/hbase-filesystem/pull/29#discussion_r746864829



##########
File path: hbase-oss/src/main/java/org/apache/hadoop/hbase/oss/sync/TreeLockManager.java
##########
@@ -488,7 +488,18 @@ public void close() throws IOException {
         try {
           writeUnlock(src);
         } finally {
-          writeUnlock(dst);
+          try {
+            writeUnlock(dst);
+          } finally {
+            // Tricky... HBossContract tests tough things like
+            //   `rename("/", "/somethingelse")`
+            // This means we grabbed write locks on
+            //    /               (src)
+            //    /somethingelse  (dst)
+            // Thus, we can't safely delete the znodes for src as it may
+            // then also affect the (held) lock on the dst.
+            recursiveDelete(src);

Review comment:
       One thing I'm worried about after looking at this (for the third time): is it safe to delete the znodes on the src if the rename was unsuccessful? I need to think about this.




-- 
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@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org