Skip to content

[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

Merged
merged 7 commits into from
May 1, 2025
Merged

[ENH] Fork the wal3 log. #4416

merged 7 commits into from
May 1, 2025

Conversation

rescrv
Copy link
Contributor

@rescrv rescrv commented May 1, 2025

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.

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

Documentation Changes

None for chroma. wal3 interface not public.

@rescrv rescrv requested a review from Sicheng-Pan May 1, 2025 15:22
Copy link

github-actions bot commented May 1, 2025

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)

Base automatically changed from rescrv/limits to main May 1, 2025 15:32
rescrv added 2 commits May 1, 2025 08:36
This commit adds parity for copying the wal3 log.  This supports
forking.
@rescrv rescrv force-pushed the rescrv/fork-the-log branch from e619331 to 2479280 Compare May 1, 2025 15:36
Comment on lines 800 to 806
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));
Copy link
Contributor

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?

Comment on lines +823 to +825
let max_offset = log_reader.maximum_log_position().await.map_err(|err| {
Status::new(err.code().into(), format!("Failed to copy log: {}", err))
})?;
Copy link
Contributor

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() {
Copy link
Contributor

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

Copy link
Contributor

@Sicheng-Pan Sicheng-Pan left a 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

@rescrv rescrv merged commit 7382cd0 into main May 1, 2025
70 checks passed
@rescrv rescrv deleted the rescrv/fork-the-log branch May 1, 2025 19:35
warpbuild-benchmark-bot bot added a commit to WarpBuilds/chroma that referenced this pull request May 1, 2025
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