Resolve (programmatically) foreign table refresh race condition on Geo upgrade

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

Problem to solve

#32386 (closed) solves a race condition with documentation instructions. This issue intends to solve it without any effort by sysadmins.

Intended users

Further details

Proposal

See discussions below for multiple proposals.

Permissions and Security

Testing

What does success look like, and how can we measure that?

  • Manually modify the latest migration on primary to do nothing on down and to only sleep(30) on up
  • Primary: sudo gitlab-rake db:rollback
  • Secondary: sudo rake geo:refresh_foreign_tables
  • Primary: sudo gitlab-rake db:migrate on primary
  • Observe waiting for migrations to finish and be replicated
  • Observe foreign tables being refreshed

What is the type of buyer?

  • Premium
  • Ultimate

Links / references

Edited by 🤖 GitLab Bot 🤖