feat(spans): Add flush_id to flushed segment messages#113416
Merged
Conversation
Add a unique UUID (flush_id) to each message produced by FlushedSegment.to_messages(). The UUID is generated at call time, ensuring that if a segment is flushed twice from Redis (e.g., due to race conditions), each flush produces distinct IDs that downstream consumers can use for deduplication. Refs INC-2116 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
untitaker
marked this pull request as ready for review
April 20, 2026 13:09
Contributor
Backend Test FailuresFailures on
|
lvthanh03
approved these changes
Apr 20, 2026
untitaker
enabled auto-merge (squash)
April 20, 2026 13:47
3 tasks
joshuarli
added a commit
that referenced
this pull request
Apr 22, 2026
…ommits spans/test_buffer.py: - test_to_messages_under_limit: our commit reverted the flush_id assertions added in #113416; restore messages[0]["spans"] == spans with flush_id checks - test_max_segment_spans_limit: our commit wrongly expected segment.spans == [] (dropped); master expects len == 5 (chunked at message level) - test_dropped_spans_emit_outcomes: missing enforce-segment-size: True, so the Lua script never drops spans and track_outcome is never called integrations/opsgenie/test_integration.py: our commit replaced OpsgenieUpdateConfigTest(TestCase) with OpsgenieIntegrationTest (IntegrationTestCase) which uses the old web pipeline. Opsgenie now has get_pipeline_views() = [], so any GET immediately calls finish_pipeline() without installation_data. Restore master's class. core/endpoints/test_organization_details.py: our commit removed str() from defaultCodingAgentIntegrationId assertions; the API returns string IDs (Sentry convention), so str(integration.id) is correct. incidents/endpoints/test_organization_alert_rule_details.py: skip test_delete_trigger_dual_update_resolve — CrossTransactionAssertionError in _pre_setup() when a prior test leaves an open silo DB transaction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a unique UUID (
flush_id) to each message produced byFlushedSegment.to_messages(). The UUID is generated at call time, right before JSON serialization.This allows us to see whether the duplicate segments we observe "come from" redis, or whether they are created post-serialization.
ref INC-2116
ref STREAM-881