Skip to content

feat(debug files): Use legacy IDs for lookups - #128494

Merged
loewenheim merged 11 commits into
sebastian/correctly-read-wasm-ids-2from
sebastian/query-legacy-ids-2
Oct 27, 2026
Merged

loewenheim merged 11 commits into
sebastian/correctly-read-wasm-ids-2from
sebastian/query-legacy-ids-2

Conversation

@loewenheim

Copy link
Copy Markdown
Contributor

Second try of #127577, which was reverted in dad0221.

This uses the wasm_legacy_code_id and wasm_legacy_debug_id fields, which we started writing in #127557, for debug file lookups.

This works by making three comparisons instead of one, both for code and debug IDs. Taking debug IDs as the example:

compare the request debug ID to the stored debug ID (this is how it works right now)
compare the request debug ID to the stored wasm_legacy_debug_id
compare the legacy debug ID computed from the request to the stored debug ID

(1) covers the cases where the request and the stored file agree on the debug ID. (2) takes care of the case where the file was uploaded with a correct debug ID, but the request still has the legacy one. (3) handles the converse case, where the file was uploaded with a legacy ID but the request has the correct one. For this case, it's essential that the legacy debug ID can be computed from the correct one.

Implements INGEST-1293.

@loewenheim
loewenheim added this pull request to stack #128495 October 22, 2026 07:41
@loewenheim
loewenheim requested a review from a team as a code owner October 22, 2026 07:41
@linear-code

linear-code Bot commented Oct 22, 2026

Copy link
Copy Markdown

INGEST-1293

@loewenheim
loewenheim requested a review from a team October 22, 2026 07:41
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 22, 2026
@loewenheim loewenheim changed the title Sebastian/query legacy ids 2 feat(debug files): Use legacy IDs for lookups Oct 22, 2026

@wedamija wedamija 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.

What's the main difference between this and the previous query? I'm curious what caused the downtime last time

@loewenheim

Copy link
Copy Markdown
Contributor Author

What's the main difference between this and the previous query?

Sorry, should've explained that in the PR. There's no code difference, the problem last time was that I neglected to create an index that this query needs to be performant. I have since verified that the index exists and the query plan uses it.

Before merging this I'll also gate it behind a rollout option.

@loewenheim
loewenheim force-pushed the sebastian/query-legacy-ids-2 branch from f818c08 to 765a78c Compare October 27, 2026 11:54
@sentry

sentry Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
- - - - - - ✅ 760 uploaded

Waiting for base snapshots to finish uploading. This comment will update automatically within ~10 minutes or fail.

⚙️ sentry-frontend Snapshot Settings

@loewenheim
loewenheim requested review from Dav1dde and jjbayer October 27, 2026 12:02

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ed638c9. Configure here.

Comment thread src/sentry/api/endpoints/debug_files.py Resolved
This uses the `wasm_legacy_code_id` and `wasm_legacy_debug_id` fields,
which we started writing in #127557, for debug file lookups.

This works by making three comparisons instead of one, both for code and
debug IDs. Taking debug IDs as the example:

1. compare the request debug ID to the stored debug ID (this is how it
   works right now)
2. compare the request debug ID to the stored `wasm_legacy_debug_id`
3. compare the legacy debug ID computed from the request to the stored
   debug ID

(1) covers the cases where the request and the stored file agree on the
debug ID. (2) takes care of the case where the file was uploaded with
a correct debug ID, but the request still has the legacy one. (3) handles
the converse case, where the file was uploaded with a legacy ID but the
request has the correct one. For this case, it's essential that the
legacy debug ID can be computed from the correct one.

Implements INGEST-1293.
@loewenheim
loewenheim force-pushed the sebastian/query-legacy-ids-2 branch from f02e4cd to 223b261 Compare October 27, 2026 13:38
@loewenheim
loewenheim merged commit 7d7d7f7 into master Oct 27, 2026
89 checks passed
@loewenheim
loewenheim deleted the sebastian/query-legacy-ids-2 branch October 27, 2026 14:39
loewenheim added a commit that referenced this pull request Oct 27, 2026
Second try of #127557, which was
reverted in
a58aad2.

This updates symbolic to 14.0.0a4 for
getsentry/symbolic#1093.

The values that are written as the code and debug ID for WASM files are
now correct, but we also reproduce the previous incorrect logic and
write the results into the "legacy" fields introduced in
#127508. We do this so that
symbolication requests coming in with "legacy" IDs can still find their
files.

As such, this PR should only be merged and deployed together with
#128494.

Implements INGEST-1292.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants