Skip to content

bridge/kafka: Include partition in idempotency key - #2429

Merged
svix-jplatte merged 1 commit into
svix:mainfrom
baxori:bridge-kafka-partition-idempotency
Jul 22, 2026
Merged

bridge/kafka: Include partition in idempotency key#2429
svix-jplatte merged 1 commit into
svix:mainfrom
baxori:bridge-kafka-partition-idempotency

Conversation

@baxori

@baxori baxori commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Motivation

The current Kafka sender idempotency key uses group_id, topic, and offset.

Kafka offsets are unique only within a partition, not within a topic. Because of that, two distinct Kafka records from different partitions can produce the same idempotency key.

This can cause Svix to deduplicate non-duplicate messages.

This changes the idempotency key format. Replayed records that cross an upgrade boundary may not deduplicate against keys produced by older bridge versions. This is limited to replay and reprocessing scenarios.

Solution

  • include Kafka partition in the sender idempotency key
  • add an integration test that asserts the idempotency-key header sent by the Kafka bridge consumer

Test plan

  • cargo fmt --package svix-bridge-plugin-kafka
  • cargo test -p svix-bridge-plugin-kafka

If you'd prefer a migration-oriented rollout, I'm happy to adjust the approach.

@baxori
baxori requested a review from a team June 30, 2026 16:25
@baxori
baxori requested a review from a team as a code owner June 30, 2026 16:25
@baxori
baxori force-pushed the bridge-kafka-partition-idempotency branch from 50f98ee to f3c9354 Compare June 30, 2026 17:01
@svix-jplatte

Copy link
Copy Markdown
Member

Thanks for the PR! I'm currently pretty busy, but I'll get to reviewing this soon.

@baxori
baxori force-pushed the bridge-kafka-partition-idempotency branch 3 times, most recently from 35717d6 to b74b4a2 Compare July 13, 2026 09:37

@svix-jplatte svix-jplatte 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 to me! Could you please add a changelog entry?

@baxori
baxori force-pushed the bridge-kafka-partition-idempotency branch from b74b4a2 to cc29287 Compare July 22, 2026 13:33
@baxori

baxori commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! I've added a changelog entry.

@baxori
baxori requested a review from svix-jplatte July 22, 2026 14:00
@svix-jplatte svix-jplatte changed the title bridge/kafka: include partition in idempotency key bridge/kafka: Include partition in idempotency key Jul 22, 2026
@svix-jplatte
svix-jplatte enabled auto-merge (squash) July 22, 2026 14:07
@svix-jplatte
svix-jplatte merged commit 4f2e5d2 into svix:main Jul 22, 2026
32 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