Skip to content

Prepare and backfill a clean replacement table for oauth_access_tokens

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

Follow-up of https://gitlab.com/gitlab-org/gitlab/-/issues/521855

Proposal

We'll introduce a new unpartitioned table oauth_access_tokens_clean that mirrors the oauth_access_tokens table's schema. Then we'll add a trigger to sync the I/O operations and later backfill valid records into the table. This will then replace the original table oauth_access_tokens to reclaim the space.

Steps

Adapted from description of this issue:

  • Create oauth_access_tokens_clean table
    • Schema exactly mirrors oauth_access_tokens
    • NOT partitioned
  • Add triggers to oauth_access_tokens table that sync I/O ops to oauth_access_tokens_clean
    • Every read/write/update/delete operation propagates to oauth_access_tokens_clean
  • Create a migration to backfill existing records from oauth_access_tokens to oauth_access_tokens_clean.

Note

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

Edited by 🤖 GitLab Bot 🤖