[ 
https://issues.apache.org/jira/browse/BOOKKEEPER-417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13472221#comment-13472221
 ] 

Uma Maheswara Rao G commented on BOOKKEEPER-417:
------------------------------------------------

Hi Ivan. Patch looks great. I have one comment adding to rakesh comment.

{code}
  zkc.delete(getUrLedgerZnode(ledgerId), l.getLedgerZNodeVersion());
+                // clean up the hierarchy
+                String parts[] = getUrLedgerZnode(ledgerId).split("/");
+                for (int i = 1; i <= 4; i++) {
+                    String p[] = Arrays.copyOf(parts, parts.length - i);
+                    String path = Joiner.on("/").join(p);
+                    Stat s = zkc.exists(path, null);
+                    if (s != null) {
+                        zkc.delete(path, s.getVersion());
+                    }
+                }
{code}
Currently NotEmptyException handle for even leaf node. 
Actually we should handle only for 'clean up the hierarchy' delete call.
When we delete leaf node, expectation is that, that will be free. But for any 
reason/due to some bug, if leaf node has some child node introduced, then we 
will silently ignore here. Actually that is not expected. It should loudly 
throw exception out.
So, better to handle NotEmptyException only for hierarchy cleanup delete call. 
What do you say?
                
> Hierarchical zk underreplication manager should clean up its hierarchy when 
> done to allow for fast acquisition of underreplicated entries
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: BOOKKEEPER-417
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-417
>             Project: Bookkeeper
>          Issue Type: Sub-task
>          Components: bookkeeper-auto-recovery
>            Reporter: Ivan Kelly
>            Assignee: Ivan Kelly
>             Fix For: 4.2.0
>
>         Attachments: BOOKKEEPER-417.diff
>
>
> As we traverse the hierarchy to find a underreplicated fragment, leaving the 
> hierarchy will cause the traversal to search in many empty znodes.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to