Skip to content

feat(cogs): publish backend change streams to Kafka - #597

Open
matt-codecov wants to merge 1 commit into
matth/storage-inventory-tracker-3from
matth/storage-inventory-tracker-4
Open

feat(cogs): publish backend change streams to Kafka#597
matt-codecov wants to merge 1 commit into
matth/storage-inventory-tracker-3from
matth/storage-inventory-tracker-4

Conversation

@matt-codecov

Copy link
Copy Markdown
Contributor

connect SinkConfigs to objectstore-server conf and wire it up to the ChangeStreamFactory. this completes the objectstore code changes for storage COGS


Stack created with GitHub Stacks CLIGive Feedback 💬

@matt-codecov
matt-codecov requested a review from a team as a code owner August 11, 2026 06:15
Comment thread objectstore-server/src/config.rs
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.87179% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.46%. Comparing base (28100c2) to head (d5d5bef).

Files with missing lines Patch % Lines
objectstore-server/src/config.rs 94.59% 2 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                         @@
##           matth/storage-inventory-tracker-3     #597   +/-   ##
==================================================================
  Coverage                              88.46%   88.46%           
==================================================================
  Files                                    104      104           
  Lines                                  17055    17092   +37     
==================================================================
+ Hits                                   15087    15121   +34     
- Misses                                  1968     1971    +3     
Components Coverage Δ
Rust Backend 92.47% <94.87%> (+<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.

@matt-codecov
matt-codecov force-pushed the matth/storage-inventory-tracker-4 branch from 5c30b31 to 644c7af Compare August 11, 2026 21:34

let sink = config.change_stream.kafka.as_ref().expect("kafka sink");
assert_eq!(sink.topic, "my-topic");
assert_eq!(sink.bootstrap_servers, ["kafka:9092"]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: A partial Kafka configuration with a topic but no bootstrap_servers will be accepted at startup but will silently fail to send messages at runtime.
Severity: HIGH

Suggested Fix

Validate the SinkConfig to ensure that if the Kafka sink is enabled, the bootstrap_servers field is not empty. This check should be performed during configuration loading to cause a startup failure with a clear error message, preventing silent failures in production.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: objectstore-server/src/config.rs#L930

Potential issue: If the service is configured with a partial Kafka configuration,
specifically providing a topic but omitting the `bootstrap_servers`, the application
will start without error. The underlying `librdkafka` library accepts an empty list of
bootstrap servers during producer creation, so no startup error is logged. However, the
producer will be unable to connect to any brokers, causing all change stream messages to
be silently dropped. This can lead to an operator being unaware that their intended
configuration is not active, resulting in a loss of inventory tracking data.

Also affects:

  • objectstore-inventory-tracker/src/kafka.rs:105
  • objectstore-service/src/change_stream/kafka.rs:80

@matt-codecov
matt-codecov force-pushed the matth/storage-inventory-tracker-4 branch from 644c7af to d5d5bef Compare August 11, 2026 22:37
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.

1 participant