Skip to content

ref(crons): Make the check-in config not null - #131375

Merged
wedamija merged 4 commits into
masterfrom
danf/crons-checkin-config-not-null-column
Nov 16, 2026
Merged

wedamija merged 4 commits into
masterfrom
danf/crons-checkin-config-not-null-column

Conversation

@wedamija

@wedamija wedamija commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Part of a series that shrinks the indexes on sentry_monitorcheckin.

Every check-in has a config now, so checkin_config becomes NOT NULL. Post-deploy, because validating the constraint scans the whole table.

Merge order:

  1. perf(crons): Drop the check-in config FK index #131374
  2. ref(crons): Make the check-in config not null #131375 (post-deploy migration) ← this PR
  3. perf(crons): Make the check-in timeout index partial #131376 (post-deploy migration)

@wedamija
wedamija requested review from a team as code owners November 16, 2026 21:26
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 16, 2026
@sentry

sentry Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Sentry Snapshot Testing

Name Added Removed Changed Renamed Unchanged Skipped Status
sentry-frontend
sentry-frontend
0 0 0 0 934 0 ✅ Unchanged

⚙️ sentry-frontend Snapshot Settings

@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 9e08cb8. Configure here.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/monitors/migrations/0027_checkin_config_not_null.py

for 0027_checkin_config_not_null in monitors

--
-- Custom state/database change combination
--
ALTER TABLE "sentry_monitorcheckin" DROP CONSTRAINT IF EXISTS "sentry_monitorcheckin_checkin_config_id_17e2de71_notnull";
ALTER TABLE "sentry_monitorcheckin" ADD CONSTRAINT "sentry_monitorcheckin_checkin_config_id_17e2de71_notnull" CHECK ("checkin_config_id" IS NOT NULL) NOT VALID;
ALTER TABLE "sentry_monitorcheckin" VALIDATE CONSTRAINT "sentry_monitorcheckin_checkin_config_id_17e2de71_notnull";
ALTER TABLE "sentry_monitorcheckin" ALTER COLUMN "checkin_config_id" SET NOT NULL;
ALTER TABLE "sentry_monitorcheckin" DROP CONSTRAINT "sentry_monitorcheckin_checkin_config_id_17e2de71_notnull";

wedamija added a commit that referenced this pull request Nov 16, 2026
Part of a series that shrinks the indexes on `sentry_monitorcheckin`.

Drops the index on `checkin_config_id`. It was only needed to check that
every check-in has a config, and now they all do. Nothing deletes
configs, so the foreign key never needs it.

Merge order:
1. #131374 ← this PR
2. #131375 (post-deploy
migration)
3. #131376 (post-deploy
migration)
Base automatically changed from danf/crons-drop-checkin-config-index to master November 16, 2026 22:26
# Conflicts:
#	migrations_lockfile.txt
#	src/sentry/monitors/migrations/0026_drop_checkin_config_index.py
@wedamija
wedamija merged commit 383b49b into master Nov 16, 2026
104 of 106 checks passed
@wedamija
wedamija deleted the danf/crons-checkin-config-not-null-column branch November 16, 2026 22:44
wedamija added a commit that referenced this pull request Nov 16, 2026
Part of a series that shrinks the indexes on `sentry_monitorcheckin`.

Swaps the `(status, timeout_at)` index for a partial index on
`timeout_at` over in-progress check-ins, the only rows the timeout task
reads. Post-deploy, because it builds an index.

Merge order:
1. #131374
2. #131375 (post-deploy
migration)
3. #131376 (post-deploy
migration) ← this PR

This branch was successfully deployed

1 active deployment
Preview — 3868b22e Deployed Nov 16, 2026 by vercel[bot]
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.

2 participants