Skip to content

P11: Port optional leader startup snapshots to ZooKeeper 3.8.7 - #187

Merged
bellatrix007 merged 3 commits into
li-dev/base-3.8.7from
adbansal/zk-387-p11-startup-snapshot-stacked
Dec 3, 2026
Merged

bellatrix007 merged 3 commits into
li-dev/base-3.8.7from
adbansal/zk-387-p11-startup-snapshot-stacked

Conversation

@bellatrix007

@bellatrix007 bellatrix007 commented Nov 23, 2026 •

Copy link
Copy Markdown

Description

Forward-port #140 from branch-3.6 to ZooKeeper 3.8.7, stacked on #186.
This preserves LinkedIn's opt-in policy; it is not a verbatim Apache backport.

Adds zookeeper.leaderElection.skipStartupSnapshot (default false).
When enabled, skips the final leader-startup snapshot, avoiding that
serialization step during quorum formation. Recovery, session cleanup,
standalone startup and other snapshot paths remain unchanged.

Retains Apache 3.8.7's existing stream-based session cleanup and restores
branch-3.6's skip-log diagnostics: zxid and dead-session count.

Tests

Updated ZooKeeperServerTest, QuorumPeerTest and Zab1_0Test for
configuration, snapshot policy, DIFF/SNAP synchronization and recovered
data/ACL/session state.

Local results on bf369e4b:

Validation Java Result
Selected baseline and P09/P10/P11 tests 8, 11, 17 158 passed on each
Skip-enabled regressions 11 89 passed
Assembly, RAT, Checkstyle including tests, SpotBugs 11 Passed

Logging follow-up 8350a3cf additionally passed all 17 ZooKeeperServerTest
cases, RAT, Checkstyle including tests and SpotBugs on Java 11.

Known base CI failure: P10's Java 11 job
failed QuorumPeerMainTest.testLeaderOutOfView: expected LOOKING, observed
FOLLOWING. A duplicate CI job and a targeted local run passed; the cause
remains unresolved and is not fixed by this PR.

Linux/native, mixed-version, performance and quorum-backed backup-failover
qualification remain outstanding.

  • Local code review completed

Changes that Break Backward Compatibility (Optional)

  • The property is captured when QuorumPeer is constructed; the explicit
    setter remains available.
  • When skipping is enabled, a restart may replay more logs and repeat
    dead-session cleanup until a later snapshot is taken.
  • As in branch-3.6, leader startup calls loadData(boolean). Subclasses
    overriding only loadData() will not intercept that call.

Documentation (Optional)

Updated zookeeperAdmin.md with configuration and recovery trade-offs.

🤖 Generated with GitHub Copilot CLI

@bellatrix007
bellatrix007 added this pull request to stack #176 November 23, 2026 11:35
@bellatrix007
bellatrix007 force-pushed the adbansal/zk-387-p11-startup-snapshot-stacked branch from 8350a3c to 4eb22a8 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
@bellatrix007
bellatrix007 force-pushed the adbansal/zk-387-p11-startup-snapshot-stacked branch from 4eb22a8 to 57f7f89 Compare December 3, 2026 05:36

@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-p11-startup-snapshot-stacked branch from 57f7f89 to a9be9af Compare December 3, 2026 09:04
Base automatically changed from adbansal/zk-387-p10-acl-dry-run to li-dev/base-3.8.7 December 3, 2026 12:13
Aditi Bansal and others added 3 commits December 3, 2026 17:43
Keep the default startup snapshot while allowing quorum peers to skip the final leader snapshot. Preserve database recovery, session cleanup and learner persistence, with focused policy and synchronization coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The serialized tree contains node metadata, not the database's last processed zxid. Check the DIFF/SNAP envelope zxid and the snapshot node's creation and modification zxids while retaining data, ACL, quorum formation and recovery assertions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Retain stream-based cleanup and count each cleaned session. Cover zero and multiple dead sessions, live-session preservation and count reset between loads.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bellatrix007
bellatrix007 force-pushed the adbansal/zk-387-p11-startup-snapshot-stacked branch from a9be9af to 075e148 Compare December 3, 2026 12:13
@bellatrix007
bellatrix007 merged commit 920c09f into li-dev/base-3.8.7 Dec 3, 2026
24 checks passed
@bellatrix007
bellatrix007 deleted the adbansal/zk-387-p11-startup-snapshot-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