Skip to content

feat(cogs): create inventory-tracker crate for storage oplog - #588

Open
matt-codecov wants to merge 1 commit into
mainfrom
matth/storage-inventory-tracker
Open

feat(cogs): create inventory-tracker crate for storage oplog#588
matt-codecov wants to merge 1 commit into
mainfrom
matth/storage-inventory-tracker

Conversation

@matt-codecov

Copy link
Copy Markdown
Contributor

Ref FS-210
Related to getsentry/sentry-kafka-schemas#497

Creates the inventory-tracker crate in our project that we will use to emit Kafka messages for a change stream that we will turn into a COGS pipeline.

This crate isn't Objectstore-specific at all. If/when another service wants to use it, we can move it to a separate repository and set up a release process for it. I just couldn't be bothered if nobody's asking for it.

PR(s) that use this new crate will be along soon.

@matt-codecov
matt-codecov requested a review from a team as a code owner August 5, 2026 06:09
@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown

FS-210

@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.49493% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.13%. Comparing base (b580cf2) to head (d180831).

Files with missing lines Patch % Lines
objectstore-inventory-tracker/src/producer.rs 35.13% 24 Missing ⚠️
objectstore-inventory-tracker/src/kafka.rs 92.47% 7 Missing ⚠️
objectstore-inventory-tracker/src/tracker.rs 97.92% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #588      +/-   ##
==========================================
+ Coverage   87.99%   88.13%   +0.14%     
==========================================
  Files          96      100       +4     
  Lines       15955    16448     +493     
==========================================
+ Hits        14040    14497     +457     
- Misses       1915     1951      +36     
Components Coverage Δ
Rust Backend 92.34% <ø> (+<0.01%) ⬆️
Rust Client 81.97% <ø> (ø)
Python Client 93.31% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jan-auer jan-auer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Initial review. Some of the below comments can be left for follow-up to get a first version in, as long as they don't change the overall concept and can be fixed in isolation. Particularly, shutdown is a larger topic.

Comment thread Cargo.toml Outdated
Comment thread Cargo.toml Outdated
Comment thread objectstore-inventory-tracker/src/lib.rs Outdated
/// Enqueues one record.
///
/// `key` controls which partition receives the message.
fn send(&self, key: &[u8], payload: Vec<u8>) -> Result<(), Self::Error>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

At least in arroyo / librdkafka, my understanding is that because of message batching sending a message can also fail after they were initially recorded. With the fire-and-forget style send API, these errors will not be returned anymore.

For us, this is likely fine - we want non-blocking best effort submission. Though we should pick one of the below options:

  • Acknowledge this in the doc comment and call out that not all errors can be captured
  • Make the signature infallible and move the responsibility for handling errors to the producer implementation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The on_delivery_failure argument to the Kafka producer should give callers a hook into failed messages. Failures here are when, like, the local queue is full or something.

Comment thread inventory-tracker/src/kafka.rs Outdated

@jan-auer jan-auer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. See the open comments before merge, please.

Either in this PR or in a follow up, I'd suggest to add metrics, especially for errors.

@matt-codecov
matt-codecov force-pushed the matth/storage-inventory-tracker branch from 71877b3 to d180831 Compare August 7, 2026 01:45
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