-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[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
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
51295b2
to
cad8641
Compare
Add Bootstrap Functionality to wal3 Log from Existing Content This PR introduces a new Key Changes: Affected Areas: Potential Impact: Functionality: Enables initializing Rust-based logs from arbitrary existing data, facilitating system migrations and recovery scenarios. Performance: No significant runtime path changes; only affects manual/admin/bootstrap operations. Security: No sensitive information exposed, but as with all initialization routines, care must be taken to avoid race conditions. Scalability: No impact on log scalability or concurrency in normal operation; bootstrap is a one-time admin operation. Review Focus: Testing Needed• Run the new integration tests to verify both non-empty and empty bootstrapping. Code Quality Assessmentrust/wal3/src/writer.rs: Well-reasoned, clear inline documentation, explains invariants and known tradeoffs. rust/wal3/src/reader.rs: Minor improvement with Default derivation; otherwise unchanged. rust/wal3/tests/test_k8s_integration_83_bootstrap.rs: Good scenario and data validation. rust/wal3/tests/test_k8s_integration_84_bootstrap_empty.rs: Test coverage for empty bootstraps. Best PracticesModularization: Atomicity: Testing: Documentation: Error Handling: Potential Issues• Very rare edge case where a 'hole' (FragmentSeqNo(1)) is left if initialization and bootstrap race, but this is predicated not to occur in expected workflows. This summary was automatically generated by @propel-code-bot |
The space of cases I have to handle: panic(BenignRace, AlreadyInitialized, Uninitialized) -> cannot double-initialize manifest panic(BenignRace, AlreadyInitialized, Failure) -> cannot double-initialize manifest panic(BenignRace, AlreadyInitialized, Success) -> cannot double-initialize manifest panic(Success, AlreadyInitialized, Uninitialized) -> cannot double-initialize manifest panic(Success, AlreadyInitialized, Failure) -> cannot double-initialize manifest panic(Success, AlreadyInitialized, Success) -> cannot double-initialize manifest panic(BenignRace, Uninitialized, Failure) -> failed to install recovered manifest panic(BenignRace, Success, Failure) -> failed to install recovered manifest panic(Success, Uninitialized, Failure) -> failed to install recovered manifest panic(Success, Success, Failure) -> failed to install recovered manifest panic(BenignRace, Uninitialized, Uninitialized) -> cannot have manifest become uninitialized panic(BenignRace, Success, Uninitialized) -> cannot have manifest become uninitialized panic(Success, Uninitialized, Uninitialized) -> cannot have manifest become uninitialized panic(Success, Success, Uninitialized) -> cannot have manifest become uninitialized Committing so I don't lose it.
/// and I'd prefer to manually inspect failures than get the automation right to do it always | ||
/// automatically. Bootstrap is intended only to last as long as there is a migration from the | ||
/// go to the rust log services. | ||
pub async fn bootstrap<D: MarkDirty>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be good to have a basic test for this
cd14dcb
to
307051a
Compare
fc8b17c
to
dbb2ec3
Compare
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
pytest
for python,yarn test
for js,cargo test
for rustDocumentation Changes
N/A