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::ArchiveRevokedAccessTokenshas been finalized in18.8-
Remove code and tests related to
Gitlab::BackgroundMigration::ArchiveRevokedAccessTokensaccording to finalization documentation
-
Remove code and tests related to
-
Archived records cleanup:
-
Drop temporary
oauth_access_tokens_archived_recordstable - Remove related code and update worker condition since inserting into the archived table is no longer required
-
Add index on
revoked_at
-
Drop temporary