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

[BUG] Count should handle uninit'ed segments #2193

Merged
merged 2 commits into from
May 14, 2024
Merged

Conversation

HammadB
Copy link
Collaborator

@HammadB HammadB commented May 13, 2024

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Count should handle uninit'ed segments
  • New functionality
    • None

Test plan

How are these changes tested?
#2185 should add tests for the count() operator

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

Documentation Changes

None

Copy link

vercel bot commented May 13, 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 14, 2024 5:14pm

Copy link

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)

@HammadB HammadB requested a review from sanketkedia May 13, 2024 23:21
match *e {
RecordSegmentReaderCreationError::UninitializedSegment => {
// This means no compaction has occured.
return Ok(CountRecordsOutput { count: 0 });
Copy link
Contributor

Choose a reason for hiding this comment

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

This is incorrect. In this case, the count should be the count from the logs and not 0. My 2c is to do it correctly now instead of deferring

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh woops :). you are correct! my bad

Copy link
Collaborator Author

@HammadB HammadB May 14, 2024

Choose a reason for hiding this comment

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

Hm actually no. I don't think this is wrong. The calling code adds the log count in.

match channel.send(Ok(msg.count + self.log_record_count)) {

I think in #2185 you change the structure which makes the comment above relevant.

Would you prefer I wait that is landed and merge accordingly?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you are correct. I had #2185 in mind when making this comment. I had mentally merged the two PRs in my mind (since that is what would've happened when resolving conflicts). I think we should wait for that to be landed

@HammadB HammadB merged commit 9289bc4 into main May 14, 2024
46 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.

None yet

2 participants