Make sure primary node is down when promoting a secondary node

The command to promote the secondary node to primary display a warning message that mentions to “Make sure your primary is down”. How does an admin know if the primary is down, and what happens if it still happens to be running?

Proposal

Update the gitlab-ctl promote-to-primary-node command to do the following:

  1. Check TCP connectivity to the primary's PostgreSQL server.
  2. Call the health endpoint on the primary node.

In case that any of those calls do not fail we should abort the command.

/cc @stanhu @jramsay

Edited Jan 25, 2018 by Douglas Barbosa Alexandre
Assignee Loading
Time tracking Loading