-
Notifications
You must be signed in to change notification settings - Fork 2k
[ENH] wal3::copy implemented using scan/AWS copy #4803
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
|
|
Refactor wal3::copy to Use LogReader Scan and Direct AWS Copy; Simplify Snapshot Handling This PR significantly refactors the Key Changes: Affected Areas: Potential Impact: Functionality: Fragment copy is now always a flat operation; all eligible fragments are copied in one batch, and the destination manifest contains only fragments (no snapshots), which may affect systems expecting snapshot hierarchy. Removal of per-snapshot copying may affect incremental copy or restore workflows. Performance: Potentially improved performance due to parallelized fragment copying, but risks with very large manifests if the number of fragments is excessive (bounded by manifest branching factor). Security: No new security concerns introduced; storage/copy routines are largely unchanged. Scalability: Scalability remains similar or improved due to parallel copy, but copying very large logs in a single manifest could hit scale/manifest size limits without snapshotting. Review Focus: Testing Needed• Run rust integration test suite, especially log copy/update and scrub scenarios. Code Quality Assessmentrust/wal3/tests/test_k8s_integration_82_copy_then_update_dst.rs: Test resource names adjusted throughout for correct target/source mapping. rust/wal3/src/copy.rs: Major simplification, correct use of async/await and error propagation. Awareness of branching factor was noted in comments. rust/wal3/src/reader.rs: Limits struct improved, code remains clear. Test cases updated. rust/wal3/src/lib.rs: Utility function added, code stays clean and idiomatic. rust/wal3/src/manifest.rs: Scrub logic extended to sum bytes as well as setsums for full manifest validation. Best PracticesManifest Integrity: Test Coverage: Code Simplicity: Async: Potential Issues• Manifest-only destination may not scale if the log consists of a very large number of fragments and snapshotting is not re-enabled before/during copy-could hit manifest or API size limits. This summary was automatically generated by @propel-code-bot |
| acc_bytes, | ||
| writer: "copy task".to_string(), | ||
| snapshots, | ||
| snapshots: vec![], |
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.
what if there is too many frags? should we construct snapshot in that case? or will that be done automatically later?
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.
update: the number of manifest should be guaranteed to be bounded by the branching factor
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.
It will be done on next write. I was trying not to complicate this code. The test does this implicitly. I can add a check for it.
This API will use the serverside option to upload a file, meaning that copying a file becomes a cheap operation, relatively speaking. No longer will it have to stream to the rust-log-service and back to S3.
025899c to
bd68f48
Compare
ed17688 to
557c6fa
Compare
This PR uses the `LogReader`'s standard `scan` method to select fragments for copying. It then issues a copy in parallel and writes them to the manifest as one list, without accounting for snapshots. Alternatives considered: - Potentially walk the snapshots and copy/paste snapshots. This is what was done before, but it could only prune to boundaries of snapshot pointers in the root/manifest of the tree. - Use the GC logic to prune. This was originally my intent, but it had a hidden downside: The GC would walk all old snapshots to determine what data it had to delete. Implementing a switch to skip this behavior essentially made two distinct functions in one, obviating the advantage of reusing the GC code.
557c6fa to
52e1fb6
Compare
## Description of changes This PR uses the `LogReader`'s standard `scan` method to select fragments for copying. It then issues a copy in parallel and writes them to the manifest as one list, without accounting for snapshots. Alternatives considered: - Potentially walk the snapshots and copy/paste snapshots. This is what was done before, but it could only prune to boundaries of snapshot pointers in the root/manifest of the tree. - Use the GC logic to prune. This was originally my intent, but it had a hidden downside: The GC would walk all old snapshots to determine what data it had to delete. Implementing a switch to skip this behavior essentially made two distinct functions in one, obviating the advantage of reusing the GC code. ## Test plan Integration tests cover copy. - [X] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes N/A
Description of changes
This PR uses the
LogReader's standardscanmethod to selectfragments for copying. It then issues a copy in parallel and writes
them to the manifest as one list, without accounting for snapshots.
Alternatives considered:
was done before, but it could only prune to boundaries of snapshot
pointers in the root/manifest of the tree.
a hidden downside: The GC would walk all old snapshots to determine
what data it had to delete. Implementing a switch to skip this
behavior essentially made two distinct functions in one, obviating the
advantage of reusing the GC code.
Test plan
Integration tests cover copy.
pytestfor python,yarn testfor js,cargo testfor rustDocumentation Changes
N/A