-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ENH] Fork the wal3 log. #4416
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
[ENH] Fork the wal3 log. #4416
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
This commit adds parity for copying the wal3 log. This supports forking.
e619331
to
2479280
Compare
rust/log-service/src/lib.rs
Outdated
let cursor_name = &COMPACTION; | ||
let witness = cursors.load(cursor_name).await.map_err(|err| { | ||
Status::new(err.code().into(), format!("Failed to load cursor: {}", err)) | ||
})?; | ||
let offset = witness | ||
.map(|x| x.1.position) | ||
.unwrap_or(LogPosition::from_offset(1)); |
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.
Is this the compaction offset? If so does it represent the last offset has been compacted or the next offset to compact?
let max_offset = log_reader.maximum_log_position().await.map_err(|err| { | ||
Status::new(err.code().into(), format!("Failed to copy log: {}", err)) | ||
})?; |
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.
Similar question: Is this the offset of the next log to be written on the log or the last log written
}; | ||
|
||
#[tokio::test] | ||
async fn test_k8s_integration_80_copy() { |
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.
nit: can you extend this test to check: if new data is written to the original log, the copied log does not change, and vice versa
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.
Lgtm. Please add some comments to the questions above and make sure there is no off-by-one errors here
Description of changes
This commit adds parity for copying the wal3 log. This supports
forking.
Test plan
Get test_fork to pass with this with wal3 enabled.
pytest
for python,yarn test
for js,cargo test
for rustDocumentation Changes
None for chroma. wal3 interface not public.