Skip to content

fix(snuba commit log): Modify Rust consumer to produce next message offset to Snuba commit log#7852

Open
shashjar wants to merge 1 commit intomasterfrom
shashjar/produce-next-offset-to-snuba-commit-log-from-rust-consumer
Open

fix(snuba commit log): Modify Rust consumer to produce next message offset to Snuba commit log#7852
shashjar wants to merge 1 commit intomasterfrom
shashjar/produce-next-offset-to-snuba-commit-log-from-rust-consumer

Conversation

@shashjar
Copy link
Copy Markdown
Member

@shashjar shashjar commented Mar 30, 2026

https://linear.app/getsentry/issue/ID-1390/investigate-end-to-end-slo-burn-in-geicogs

Fixes a bug in the Snuba Rust consumer. When producing commit log entries, the Rust consumer currently uses the current offset (the offset of the latest event which has been persisted to CH). By contrast, the Python consumer uses the next offset (the offset of the first event which has not yet been persisted to CH).

Sentry-side, the SynchronizedConsumer implementation blocks if message.offset >= remote_offset. It therefore expects the remote_offset it got from the Snuba commit log to be the offset of the next event, not the current one.

This off-by-one bug has been causing increased event latency in the Geico and Goldman Sachs regions since we increased the number of partitions in the PPF for INC-2007, since lone events spend more time waiting in sparse partitions for another event to enter (SLO burn, increased PPF consumer latency).

This PR brings the Rust consumer into line with the Python consumer and the SynchronizedConsumer's expectations.

More context / discussion in this Slack thread

@shashjar shashjar changed the title fix(snuba commit log): Modify Rust consumer to produce _next_ message offset to Snuba commit log fix(snuba commit log): Modify Rust consumer to produce next message offset to Snuba commit log Mar 30, 2026
partition.index,
CommitLogEntry {
offset,
offset: offset + 1,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Would like to confirm two things with EAP:

  1. Were these offset semantics intended behavior for any reason?
  2. Are there any consumers of Snuba commit log entries other than the SynchronizedConsumer implementation (post-process forwarder consumers)? If so and they rely on the current offset semantics, we may have to rethink our approach here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For (2), I believe the only other consumer of the Snuba commit log is the subscription consumer. It looks to me like the subscription consumer cares only about offset intervals (not absolute values), so I think it should be unaffected by the change in this PR (except for maybe immediately after rollout?).

@shashjar shashjar requested review from a team March 30, 2026 17:39
@shashjar shashjar marked this pull request as ready for review March 30, 2026 17:40
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