Skip to content

Swap oauth_access_grants with the clean replacement table

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

Follow-up of #561770

Proposal

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

In this issue, we swap oauth_access_grants with oauth_access_grants_clean, such that oauth_access_grants_clean becomes the new production oauth_access_grants table.

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

Steps

Adapted from description of this issue:

  • Replace oauth_access_grants table with oauth_access_grants_clean
  • 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

Note

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

Edited by Daniele Bracciani