Skip to content

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))

  1. BackgroundMigration.steal any remaining background jobs
  2. Query the background_migration_jobs table for pending records, copy those rows, and mark the tracking record succeeded
  3. VACUUM FREEZE ANALYZE the partitioned table
2. Add a new post migration to kickoff the cleanup
  1. Call the above migration helper to cleanup missed data
  2. 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