Enforce oauth_access_grants retention policy by hard deleting rows and clean up archival system

With the work in https://gitlab.com/gitlab-org/gitlab/-/issues/521855 finished the 1 month retention policy of revoked grants for oauth_access_grants is now being enforced.

The archiving infrastructure achieves a soft delete of records from oauth_access_grants. This was only necessary during the initial phase of work as a rollout safety mechanism.

Now that the production oauth_access_grants table has contained only rows within the retention policy for some time, we are confident that soft deletion is no longer necessary.

Proposal

Since proven stability, now we can clean-up the experimental code and remove BBM related code, according to the finalization documentation. We will then remove the temporary archival table, hard delete revoked tokens from oauth_access_grants.

Steps

Adapted from description of this issue:

  • Ensure Gitlab::BackgroundMigration::ArchiveRevokedAccessGrants has been finalized in 18.8
    • Remove code and tests related to Gitlab::BackgroundMigration::ArchiveRevokedAccessGrants according to finalization documentation
  • Archived records cleanup:
    • Drop temporary oauth_access_grants_archived_records table
    • Remove related code and update worker condition since inserting into the archived table is no longer required
    • Remove unnecessary index index_oauth_access_grants_on_created_at_expires_in
    • Add index on revoked_at
Edited by Daniele Bracciani