Repository navigation
ref(crons): Remove monitor from the check-in model - #127646
Conversation
|
This PR has a migration; here is the generated SQL for for --
-- Alter field monitor on monitorcheckin
--
SET CONSTRAINTS "sentry_monitorcheckin_monitor_id_c15ff0f0_fk_sentry_monitor_id" IMMEDIATE; ALTER TABLE "sentry_monitorcheckin" DROP CONSTRAINT "sentry_monitorcheckin_monitor_id_c15ff0f0_fk_sentry_monitor_id";
ALTER TABLE "sentry_monitorcheckin" ALTER COLUMN "monitor_id" DROP NOT NULL;for --
-- Remove index sentry_moni_monitor_0a49ce_idx from monitorcheckin
--
DROP INDEX CONCURRENTLY IF EXISTS "sentry_moni_monitor_0a49ce_idx";
--
-- Remove index sentry_moni_monitor_7ed5ce_idx from monitorcheckin
--
DROP INDEX CONCURRENTLY IF EXISTS "sentry_moni_monitor_7ed5ce_idx";
--
-- Moved monitorcheckin.monitor field to pending deletion state
--
-- (no-op) |
f03dfbf to
aacd7de
Compare
15ba4bd to
8c4eb95
Compare
Sentry Snapshot Testing
|
|
This PR has a migration; here is the generated SQL for for --
-- Alter field monitor on monitorcheckin
--
SET CONSTRAINTS "sentry_monitorcheckin_monitor_id_c15ff0f0_fk_sentry_monitor_id" IMMEDIATE; ALTER TABLE "sentry_monitorcheckin" DROP CONSTRAINT "sentry_monitorcheckin_monitor_id_c15ff0f0_fk_sentry_monitor_id";
ALTER TABLE "sentry_monitorcheckin" ALTER COLUMN "monitor_id" DROP NOT NULL;for --
-- Remove index sentry_moni_monitor_0a49ce_idx from monitorcheckin
--
DROP INDEX CONCURRENTLY IF EXISTS "sentry_moni_monitor_0a49ce_idx";
--
-- Remove index sentry_moni_monitor_7ed5ce_idx from monitorcheckin
--
DROP INDEX CONCURRENTLY IF EXISTS "sentry_moni_monitor_7ed5ce_idx";
--
-- Moved monitorcheckin.monitor field to pending deletion state
--
-- (no-op) |
93b8891 to
bb5f681
Compare
cbcb40b to
c28d830
Compare
c28d830 to
1c90d7b
Compare
|
This PR has a migration; here is the generated SQL for for --
-- Remove index sentry_moni_monitor_0a49ce_idx from monitorcheckin
--
DROP INDEX CONCURRENTLY IF EXISTS "sentry_moni_monitor_0a49ce_idx";
--
-- Remove index sentry_moni_monitor_7ed5ce_idx from monitorcheckin
--
DROP INDEX CONCURRENTLY IF EXISTS "sentry_moni_monitor_7ed5ce_idx";
--
-- Moved monitorcheckin.monitor field to pending deletion state
--
-- (no-op) |
Part of a series reducing crons database work per check-in, as check-in volume grows. Removes `monitor` from the `MonitorCheckIn` model along with its two indexes, `(monitor, date_added, status)` (~75 GB) and `(monitor, status, date_added)` (~59 GB). The migration drops the indexes concurrently and uses `SafeRemoveField` with `MOVE_TO_PENDING`, so the column stays until the next PR. It is post-deployment because of the index sizes. Co-Authored-By: Claude <noreply@anthropic.com>
1c90d7b to
c4aabd8
Compare
DROP INDEX CONCURRENTLY does not scan the table, so this does not need to be a post-deployment migration. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9e329c3. Configure here.
| # is a schema change, it's completely safe to run the operation after the code has deployed. | ||
| # Once deployed, run these manually via: https://develop.sentry.dev/database-migrations/#migration-deployment | ||
|
|
||
| is_post_deployment = False |
There was a problem hiding this comment.
Index drop not marked post-deployment
Medium Severity
Setting is_post_deployment to False makes this migration run automatically during deploy. The two unused monitor indexes on MonitorCheckIn are about 75 GB and 59 GB, so dropping them inline can stall or fail the deploy instead of being applied later through the post-deployment path.
Reviewed by Cursor Bugbot for commit 9e329c3. Configure here.


Part of a series reducing crons database work per check-in, as check-in volume grows.
Removes
monitorfrom theMonitorCheckInmodel along with its two indexes,(monitor, date_added, status)(~75 GB) and(monitor, status, date_added)(~59 GB). The migration drops the indexes withDROP INDEX CONCURRENTLYand usesSafeRemoveFieldwithMOVE_TO_PENDING, so the column stays until the next PR.Do not merge until #127644 has deployed.