Skip to content
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] Use log position from sysdb to as the offset to pull from log #2132

Merged
merged 1 commit into from
May 6, 2024

Conversation

Ishiihara
Copy link
Contributor

@Ishiihara Ishiihara commented May 3, 2024

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes

    • Currently, we commit the log position for a collection in both sysdb and log service. The commit to the sysdb must be successful for the files visible to query nodes. The commit to offset is best effort and can be behind in case of failures happening in between the commit to sysdb and to the log service.
    • The log position committed in the log service is used to by compactor to figure out what which collections has new data that needs to be compacted the offsets for the new logs. Since the log position in the log service can be lagged and we need to use the log position in sysdb when fetching from the log during compaction.
    • This PR compares the log position in sysdb and log and use the larger one of the 2. An alternative solution would be filtering out the log records with offset smaller than the log position in sysdb. However, that solution needs to inspect every log record fetched from the log service.
  • New functionality.

    • ...

Test plan

How are these changes tested?

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

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?

Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
chroma ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 6, 2024 5:18pm

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @Ishiihara and the rest of your teammates on Graphite Graphite

Copy link

github-actions bot commented May 3, 2024

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)

@Ishiihara Ishiihara changed the title [CLN]: update helm chart to work with configmap (#2127) [ENH] Use log position from sysdb to as the offset to pull from log May 3, 2024
@Ishiihara Ishiihara self-assigned this May 6, 2024
@Ishiihara Ishiihara requested review from HammadB and sanketkedia and removed request for HammadB May 6, 2024 16:28
@Ishiihara Ishiihara marked this pull request as ready for review May 6, 2024 16:28
@@ -354,7 +354,7 @@ mod tests {
dimension: Some(1),
tenant: tenant_1.clone(),
database: "database_1".to_string(),
log_position: 0,
log_position: -1,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need to be -1?

Copy link
Collaborator

@HammadB HammadB left a comment

Choose a reason for hiding this comment

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

looks great thanks

@Ishiihara Ishiihara merged commit 970ac74 into main May 6, 2024
47 checks passed
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