Skip to content

[ENH] Bootstrap a wal3 log from existing content. #4560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: rescrv/wal3-bootstrap
Choose a base branch
from

Conversation

rescrv
Copy link
Contributor

@rescrv rescrv commented May 15, 2025

Description of changes

This adds a "bootstrap" call to wal3 that copies the data semi-atomically. It is reasoned to be
safe to do concurrent with all other log operations, but may leave a FragmentSeqNo(1) lying around
in the event that a log is initialized at the same time it's bootstrapping. This should never
happen in our system so thankfully we can just leave the hole.

See #4558 for the reasoning.

Test plan

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

N/A

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@rescrv rescrv force-pushed the rescrv/wal3-bootstrap-impl branch from 51295b2 to cad8641 Compare May 16, 2025 19:44
@rescrv rescrv requested review from codetheweb and sanketkedia May 16, 2025 22:00
@rescrv rescrv marked this pull request as ready for review May 16, 2025 22:00
Copy link
Contributor

Bootstrap WAL3 Log from Existing Content

This PR adds a 'bootstrap' function to WAL3 that enables initializing a new log with a batch of existing data. The implementation copies data semi-atomically and is designed to be safe to use concurrently with other log operations. Though there's a potential edge case where a FragmentSeqNo(1) hole might be created during simultaneous initialization and bootstrapping, this is deemed acceptable as it shouldn't occur in the system's normal operation.

Key Changes:
• Added a new bootstrap method to copy existing content to a new WAL3 log
• Implemented semi-atomic data copy that's safe to run concurrently with other operations
• Added reasoning and safety comments throughout the code

Affected Areas:
• rust/wal3/src/writer.rs

This summary was automatically generated by @propel-code-bot

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.

1 participant