Skip to content

[ENH] When the log offset is behind sysdb, this can repair it safely. #4722

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 5 commits into from
Jun 17, 2025

Conversation

rescrv
Copy link
Contributor

@rescrv rescrv commented Jun 3, 2025

Description of changes

This adds a tool to make the log offset match sysdb. Then a test to make sure it cannot move things
backwards breaking invariants.

Test plan

Added a test.

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

Documentation Changes

N/A

Copy link

github-actions bot commented Jun 3, 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)

Copy link
Contributor

propel-code-bot bot commented Jun 3, 2025

Add Log Offset Repair Tool and Make CheckCollections Return Log Offset

This PR introduces a new Rust command-line tool for safely repairing log offsets by synchronizing them with sysdb, preventing log offsets from being moved backwards and thereby preserving invariants. It also updates the system to return the log offset in sysdb's CheckCollections gRPC/proto API, adds supporting plumbing to Go and Rust code (including new test coverage), and provides a test ensuring offsets never regress.

Key Changes:
• New Rust tool (chroma-update-collection-log-offset.rs) to synchronize log-service log offsets with sysdb for a given collection
• CheckCollectionsResponse in protobuf API now returns both deleted status and log_position for each collection
• Go sysdb table_catalog, coordinator, and grpc layers updated to propagate and respect log_position values
• Integration and error handling updates to ensure deleted or abnormal collections are not processed
• Comprehensive Rust test added to verify update_collection_log_offset logic never moves offsets backwards

Affected Areas:
• Rust log-service (bin and lib)
• Go sysdb coordinator, grpc server, and table_catalog
• IDL protobuf definitions for sysdb/CheckCollections
• Testing for log-service

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

@rescrv rescrv closed this Jun 6, 2025
@rescrv rescrv deleted the rescrv/utility-to-update-sysdb branch June 6, 2025 17:20
@rescrv rescrv restored the rescrv/utility-to-update-sysdb branch June 6, 2025 17:21
@rescrv rescrv reopened this Jun 6, 2025
@rescrv rescrv force-pushed the rescrv/utility-to-update-sysdb branch from d382541 to dddd899 Compare June 9, 2025 15:27
@rescrv rescrv requested a review from Sicheng-Pan June 9, 2025 19:42
std::process::exit(13);
}
if collection_info.deleted[0] {
eprintln!("cowardly refusing to do anything with a deleted database");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "deleted collection"?

@rescrv rescrv force-pushed the rescrv/utility-to-update-sysdb branch from dddd899 to 2da1187 Compare June 17, 2025 18:15
@rescrv rescrv merged commit 039c680 into main Jun 17, 2025
112 of 114 checks passed
@rescrv rescrv deleted the rescrv/utility-to-update-sysdb branch June 17, 2025 21:15
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