Repository navigation
chore(releases): stop dual-writing grouprelease new_release_id - #130158
Merged
Merged
Conversation
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Raw SQL operation
--
DO $$
DECLARE
release_id_attnum smallint;
new_release_id_attnum smallint;
BEGIN
SELECT attnum INTO STRICT release_id_attnum
FROM pg_attribute
WHERE attrelid = 'sentry_grouprelease'::regclass AND attname = 'release_id';
SELECT attnum INTO STRICT new_release_id_attnum
FROM pg_attribute
WHERE attrelid = 'sentry_grouprelease'::regclass AND attname = 'new_release_id';
-- A rename keeps attnum, so the original release_id having the lower one means no swap yet.
IF release_id_attnum < new_release_id_attnum THEN
RAISE EXCEPTION 'sentry_grouprelease is not swapped; run 1252 first';
END IF;
END $$;
--
-- Moved grouprelease.new_release_id field to pending deletion state
--
-- (no-op) |
ldelvoye
marked this pull request as ready for review
November 6, 2026 19:00
markstory
approved these changes
Nov 6, 2026
Comment on lines
+24
to
+27
| -- A rename keeps attnum, so the original release_id having the lower one means no swap yet. | ||
| IF release_id_attnum < new_release_id_attnum THEN | ||
| RAISE EXCEPTION 'sentry_grouprelease is not swapped; run 1252 first'; | ||
| END IF; |
Member
There was a problem hiding this comment.
We typically haven't done deploy time checks like this. I think the extra caution is reasonable though given the consequences of making a mistake.
Member
Author
There was a problem hiding this comment.
yeah I realized while working on the swap that the previous swaps I've done were... questionable. Like they work but if anything went wrong it would be really annoying to work around partial success
Base automatically changed from
ldelvoye/feat/grouprelease-swap-release-id
to
master
November 9, 2026 18:08
ldelvoye
force-pushed
the
ldelvoye/chore/grouprelease-stop-dual-write
branch
from
November 9, 2026 18:08
a2272b3 to
532c7db
Compare
The swap made release_id the wide column, so the narrow one moves to pending deletion. The migration raises in a region that hasn't run the swap, where this code would stop filling the future release_id.
ldelvoye
force-pushed
the
ldelvoye/chore/grouprelease-stop-dual-write
branch
from
November 9, 2026 22:29
532c7db to
e44772f
Compare
ldelvoye
added a commit
that referenced
this pull request
Nov 10, 2026
resolves INFRENG-784 Drops the old int4 `new_release_id` column from `sentry_grouprelease`, the last step of widening `release_id` to int8. 1253 (#130158) moved it to pending and has finished deploying everywhere, so its swap guard has passed in every region. It also deletes the 1252 and 1253 migration tests. Both migrate back to 1251, and reversing this drop re-adds the column with a new attnum, so 1252's unswap guard sees the table as already unswapped and does nothing. #127461 removed the release swap test for the same reason.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
resolves INFRENG-783
Removes the
new_release_iddual-write and moves the column to pending deletion.Do not merge until the 1252 swap has been run by hand in every region. A deploy doesn't run it, and in an unswapped region this code would stop filling the column that becomes
release_id, so 1253 raises there and halts the deploy.