Skip to content

Conversation

@pranavm2015
Copy link

@pranavm2015 pranavm2015 commented Aug 7, 2025

This PR is currently WIP, only meant for reviewing code. Unit testing, integration testing and code quality improvements are pending.

Description

This PR adds the logic to optimize the snapshot creation process in zookeeper to enable faster leader switches.

Tests

WIP

@pranavm2015 pranavm2015 marked this pull request as ready for review August 7, 2025 07:21
}

public void takeSnapshot(boolean syncSnap) {
public void takeSnapshot(boolean syncSnap, boolean isLeaderBootupSnapshot) {

Choose a reason for hiding this comment

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

Also, add a config to determine whether parallel serialization is enabled. In case not it should use regular snapshot mechanism

Copy link
Author

Choose a reason for hiding this comment

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

+1, parallel serilazation will be config driven, along with the number of threads.

*/
public void serializeSnapshot(OutputArchive oa) throws IOException, InterruptedException {
SerializeUtils.serializeSnapshot(getDataTree(), oa, getSessionWithTimeOuts());
SerializeUtils.serializeSnapshot(getDataTree(), oa, getSessionWithTimeOuts(), false);

Choose a reason for hiding this comment

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

Let's separate API changes to a separate PR. We can have core snapshot changes in this PR

Copy link
Author

Choose a reason for hiding this comment

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

If you want to check just the logic change, you can checkout the older commit - d6474f8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants