Skip to content

Swap oauth_access_tokens with the clean replacement table

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Follow-up of #562372

Proposal

At this point, oauth_access_tokens_clean has all writes mirrored to it from oauth_access_tokens, and is backfilled with all the data from oauth_access_tokens.

In this issue, we swap oauth_access_tokens with oauth_access_tokens_clean, such that oauth_access_tokens_clean becomes the new production oauth_access_tokens table.

By doing this, we significantly cut down on the space used by the oauth_access_tokens table in the postgres cluster.

Steps

Adapted from description of this issue:

  • Replace oauth_access_tokens table with oauth_access_tokens_clean
  • 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

Note

The scope of this issue might change in case pg_repack is going to be available.

Edited by Daniele Bracciani