Cleanup background migration for partitioning audit_events
As a follow up from #218428 (closed), cleanup the background migration used to copy data into the partitioned audit_events
copy. This will be two parts:
1. Implement migration helper to cleanup background migration
Outline of the logic to cleanup after the background migration (work already underway in !35201 (merged))
-
BackgroundMigration.steal
any remaining background jobs - Query the
background_migration_jobs
table forpending
records, copy those rows, and mark the tracking recordsucceeded
-
VACUUM FREEZE ANALYZE
the partitioned table
2. Add a new post migration to kickoff the cleanup
- Call the above migration helper to cleanup missed data
- Manually add back indexes to the partitioned table to match the non-partitioned table
Since the initial partitioning migration for audit_events
will go into %13.3, this issue will be scheduled for %13.4