Skip to content
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

feat(plugin-server): Preserve distinct ID locality on overflow rerouting #21358

Merged
merged 4 commits into from
Apr 8, 2024

Conversation

tkaemming
Copy link
Contributor

@tkaemming tkaemming commented Apr 5, 2024

Problem

See #20945 for details.

Changes

See #20945 for details. This change fixes the (known) issue with that implementation.

Does this work well for both Cloud and self-hosted?

Yes.

How did you test this code?

Updated existing tests, as before.

This also is based on a couple of changes that prevent the issue we saw earlier, making this change itself safer:

This patch can be applied to this PR to demonstrate the bad behavior when running tests:

diff --git a/plugin-server/src/main/ingestion-queues/batch-processing/each-batch-ingestion.ts b/plugin-server/src/main/ingestion-queues/batch-processing/each-batch-ingestion.ts
index 313e0cf083..e659c5fa1c 100644
--- a/plugin-server/src/main/ingestion-queues/batch-processing/each-batch-ingestion.ts
+++ b/plugin-server/src/main/ingestion-queues/batch-processing/each-batch-ingestion.ts
@@ -269,7 +269,7 @@ async function emitToOverflow(queue: IngestionConsumer, kafkaMessages: Message[]
                 // ``message.key`` should not be undefined here, but in the
                 // (extremely) unlikely event that it is, set it to ``null``
                 // instead as that behavior is safer.
-                key: useRandomPartitioning ? null : message.key ?? null,
+                key: undefined,
                 headers: message.headers,
                 waitForAck: true,
             })

@tkaemming tkaemming requested a review from a team April 5, 2024 01:12
@tkaemming tkaemming merged commit 091e725 into master Apr 8, 2024
82 checks passed
@tkaemming tkaemming deleted the overflow-preserve-locality branch April 8, 2024 16:49
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