Skip to content

ref(spans): Cleanup merge payloads code and distributed payloads migration flags#111746

Merged
lvthanh03 merged 4 commits intomasterfrom
tony/cleanup-spans-dist-payloads
Mar 30, 2026
Merged

ref(spans): Cleanup merge payloads code and distributed payloads migration flags#111746
lvthanh03 merged 4 commits intomasterfrom
tony/cleanup-spans-dist-payloads

Conversation

@lvthanh03
Copy link
Copy Markdown
Member

@lvthanh03 lvthanh03 commented Mar 27, 2026

Refs STREAM-799

  • Removes the distributed payload migration flags (write-distributed-payloads, read-distributed-payloads, write-merged-payloads) and makes the distributed payloads path the only code path
  • Cleans up the entire merge set (sunionstore/payloads merging) code path from add-buffer.lua
  • Updates docs in README and buffer.py to reflect the current changes

@lvthanh03 lvthanh03 requested review from a team as code owners March 27, 2026 19:45
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 27, 2026
@linear-code
Copy link
Copy Markdown

linear-code bot commented Mar 30, 2026

Copy link
Copy Markdown
Member

@evanh evanh left a comment

Choose a reason for hiding this comment

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

Nice to see this all simplified again.

Comment on lines -3314 to -3332
register(
"spans.buffer.write-distributed-payloads",
default=False,
flags=FLAG_PRIORITIZE_DISK | FLAG_AUTOMATOR_MODIFIABLE,
)
# Switch flusher to read from distributed keys instead of merged.
register(
"spans.buffer.read-distributed-payloads",
default=False,
flags=FLAG_PRIORITIZE_DISK | FLAG_AUTOMATOR_MODIFIABLE,
)
# Set to False to stop writing merged keys and skip set merges.
# Disable after read-distributed-payloads is stable. Rollback: re-enable
# this flag to resume merged writes before reverting read-distributed-payloads.
register(
"spans.buffer.write-merged-payloads",
default=True,
flags=FLAG_PRIORITIZE_DISK | FLAG_AUTOMATOR_MODIFIABLE,
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You have to unset these in options automator before removing it from the codebase.
You can do one of these:

  1. if the default value is already matching what you see in options automator, just send a PR to remove from options automator first, then you can sedn this PR as it is
  2. if the default value is not what you have in options automator: either change the default value here first, then options automator then this; otherwise leave the option registered here, remove hte code in the rest of the pr, then remove from options automator and the option from here.

redis_ttl = options.get("spans.buffer.redis-ttl")
timeout = options.get("spans.buffer.timeout")
root_timeout = options.get("spans.buffer.root-timeout")
max_segment_bytes = options.get("spans.buffer.max-segment-bytes")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this being removed? We still enforce a maximum segment size otherwise the produced segments may be too large for Kafka downstream.

Comment thread src/sentry/spans/buffer.py
@lvthanh03 lvthanh03 merged commit 7c7ba45 into master Mar 30, 2026
72 of 73 checks passed
@lvthanh03 lvthanh03 deleted the tony/cleanup-spans-dist-payloads branch March 30, 2026 18:27
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants