Skip to content

[CLN]: split up log impls into separate files #3575

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 1 commit into from
Jan 29, 2025
Merged

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented Jan 28, 2025

Description of changes

No logic changes, just split up the single file that had both the in-memory and grpc log impls.

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?

n/a

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)

Copy link
Contributor Author

codetheweb commented Jan 28, 2025

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

@codetheweb codetheweb marked this pull request as ready for review January 28, 2025 18:44
Comment on lines +18 to +27
impl Debug for InternalLogRecord {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("LogRecord")
.field("collection_id", &self.collection_id)
.field("log_offset", &self.log_offset)
.field("log_ts", &self.log_ts)
.field("record", &self.record)
.finish()
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks as good as Derive. Any reason for manual impl?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure, Derive seems fine. Leaving as-is in this PR to avoid code change & re-org in the same PR.

Comment on lines +63 to +64
offset: i64,
batch_size: i32,
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these have to be signed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but they're also signed in the proto. Leaving as-is in this PR to avoid code change & re-org in the same PR.

pub(super) async fn update_collection_log_offset(
&mut self,
collection_id: CollectionUuid,
new_offset: i64,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this have to be signed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above comment.

Copy link
Contributor Author

codetheweb commented Jan 29, 2025

Merge activity

  • Jan 28, 7:36 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Jan 28, 7:36 PM EST: A user merged this pull request with Graphite.

@codetheweb codetheweb merged commit f455c4e into main Jan 29, 2025
91 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