Skip to content

P13: Port child-only recursive deletion to ZooKeeper 3.8.7 - #189

Merged
bellatrix007 merged 1 commit into
li-dev/base-3.8.7from
adbansal/zk-387-p13-child-only-delete-stacked
Dec 3, 2026
Merged

bellatrix007 merged 1 commit into
li-dev/base-3.8.7from
adbansal/zk-387-p13-child-only-delete-stacked

Conversation

@bellatrix007

Copy link
Copy Markdown

Description

Forward-port #159 from branch-3.6 to ZooKeeper 3.8.7, stacked on #188.
Add ZKUtil.deleteChildrenRecursive and deleteall /parent -c [-b batchSize]
to delete descendants while retaining the parent.

  • Use paginated subtree listing and existing synchronous/batched deletion.
  • Reject unchrooted /; support a chrooted root. Check the retained parent's
    child count afterward and report unsuccessful -c operations through a
    nonzero CLI exit.
  • Preserve source code, comments and diagnostics. Keep 3.8.7's existing
    ordinary-root traversal fix and callback failure-before-release ordering.

Tests

On 46b9996c:

Validation Java Result
Selected baseline, deletion/CLI and pagination regressions 8, 11, 17 76 passed on each
Assembly, RAT, Checkstyle including tests, SpotBugs 11 Passed

All 20 source-added test names are retained. Required test adaptations use
the existing Jupiter setup and preserve the target's already-fixed ordinary
root behavior. Coverage includes parent retention, batch boundaries, large
child lists, root/chroot safety and concurrent child creation.

Earlier stack CI has unresolved connection/election-test failures (#184,
#186); this PR does not fix them. Deployed/mixed-version qualification remains
separate.

  • Local code review completed

Changes that Break Backward Compatibility (Optional)

Without -c, existing 3.8.7 deletion behavior is unchanged. The new option
requires a server supporting the fork's paginated getChildren; the client's
jute.maxbuffer must be at least the server's setting.

The operation is non-atomic and lists the subtree in client memory before
deleting. Quiesce writers and size the client heap appropriately; the final
child-count check is not a lock.

Documentation (Optional)

Carry the source deleteall usage, example and operational caveats into
zookeeperCLI.md, retaining newer unrelated command help.

🤖 Generated with GitHub Copilot CLI

@bellatrix007
bellatrix007 added this pull request to stack #176 November 23, 2026 14:13
@bellatrix007
bellatrix007 force-pushed the adbansal/zk-387-p13-child-only-delete-stacked branch from 46b9996 to 0e01259 Compare November 27, 2026 07:17
@bellatrix007 bellatrix007 added the upgrade-3.8.x Port of LinkedIn patches onto Apache ZooKeeper 3.8.x label Dec 2, 2026

@arkmish arkmish left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bellatrix007
bellatrix007 force-pushed the adbansal/zk-387-p13-child-only-delete-stacked branch from 0e01259 to 0d8b410 Compare December 3, 2026 12:25
Base automatically changed from adbansal/zk-387-p12-snapshot-tools-stacked to li-dev/base-3.8.7 December 3, 2026 14:56
Carry LinkedIn PR159 directly, preserving source comments and test scenarios. Retain existing 3.8.7 root traversal and callback ordering, with required Jupiter test adaptations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bellatrix007
bellatrix007 force-pushed the adbansal/zk-387-p13-child-only-delete-stacked branch from 0d8b410 to 62c5b63 Compare December 3, 2026 14:56
@bellatrix007
bellatrix007 merged commit 27f659e into li-dev/base-3.8.7 Dec 3, 2026
24 checks passed
@bellatrix007
bellatrix007 deleted the adbansal/zk-387-p13-child-only-delete-stacked branch December 3, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upgrade-3.8.x Port of LinkedIn patches onto Apache ZooKeeper 3.8.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants