Skip to content

P12: Port snapshot diagnostic tools to ZooKeeper 3.8.7 - #188

Merged
bellatrix007 merged 2 commits into
adbansal/zk-387-p11-startup-snapshot-stackedfrom
adbansal/zk-387-p12-snapshot-tools-stacked
Dec 3, 2026
Merged

bellatrix007 merged 2 commits into
adbansal/zk-387-p11-startup-snapshot-stackedfrom
adbansal/zk-387-p12-snapshot-tools-stacked

Conversation

@bellatrix007

Copy link
Copy Markdown

Description

Forward-port #153 and #151 from branch-3.6 to ZooKeeper 3.8.7, stacked
on #187. This preserves the existing LinkedIn adaptations of Apache
ZOOKEEPER-3427 and ZOOKEEPER-4566, not a verbatim Apache backport.

  • Add the recursive snapshot-summary CLI for subtree payload bytes and
    descendant counts.
  • Keep the native 3.8.7 comparer, adding the fork's checked snapshot loader,
    input validation, interactive EOF/root handling and launcher exit propagation.
  • Preserve the fork's summary implementation, sorted output, counting rules
    and error behavior. Both tools operate offline without modifying snapshots.

Tests

On 26f15e3d:

Validation Java Result
Baseline plus SnapshotComparerTest, SnapshotRecursiveSummaryTest, SnapStreamTest 8, 11, 17 67 passed on each
Assembly, RAT, Checkstyle including tests, SpotBugs 11 Passed
Packaged Unix CLI smoke 11 16 invocations passed

Packaged checks used only distribution jars and exercised CHECKED/GZIP/SNAPPY
snapshots, spaced paths, JVM flags, invalid inputs and interactive EOF.
Input-file hashes remained unchanged.

Windows launcher execution and production-scale snapshot qualification remain
unverified. Earlier stack CI failures in the reconnect fixture (#184) and
leader-state test (#186) are outside this change.

  • Local code review completed

Changes that Break Backward Compatibility (Optional)

No server/client protocol or snapshot-format changes. The comparer now follows
the fork's stricter CLI behavior: invalid invocation exits with code 2;
snapshot read/integrity failure exits with code 1. Its Windows launcher
propagates the Java exit code.

Documentation (Optional)

Updated zookeeperTools.md with usage, aggregation semantics and limitations:
whole-snapshot memory loading, recursive traversal and no transaction-log replay.

🤖 Generated with GitHub Copilot CLI

@bellatrix007
bellatrix007 added this pull request to stack #176 November 23, 2026 13:00
@bellatrix007
bellatrix007 force-pushed the adbansal/zk-387-p12-snapshot-tools-stacked branch from 1b8cf09 to b844357 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

Aditi Bansal and others added 2 commits December 3, 2026 17:47
Preserve branch-3.6 comparer and recursive-summary behavior on the existing Apache 3.8.7 comparer, including integrity checks, CLI handling, launchers and regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Restore the branch-3.6 wording without changing executable code or indentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bellatrix007
bellatrix007 force-pushed the adbansal/zk-387-p12-snapshot-tools-stacked branch from b844357 to 9e37508 Compare December 3, 2026 12:25
@bellatrix007
bellatrix007 merged commit e393dcb into li-dev/base-3.8.7 Dec 3, 2026
27 of 28 checks passed
@bellatrix007
bellatrix007 deleted the adbansal/zk-387-p12-snapshot-tools-stacked branch December 3, 2026 14:56
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