Enforce oauth_access_tokens 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 tokens for oauth_access_tokens is now being enforced.

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

Now that the production oauth_access_tokens 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_tokens.

Steps

Adapted from description of this issue:

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