Symptoms
On a replica, ghe-repl-status reports that Git replication is out of sync or behind. For more information, see Monitoring a high-availability configuration.
Causes
Each node has a universally unique identifier (UUID) and is registered as a Git server named git-server-UUID. Git replication tries to keep repositories in sync on every registered Git server.
If a node leaves the high availability configuration, its Git server record may remain. In that case, replication keeps trying to sync repositories to that Git server. ghe-repl-status then reports replication as behind.
This can happen if:
- A node is removed from the configuration without decommissioning its UUID. This can happen after a failover.
- A backup restore to a new appliance fails before
ghe-restoreremoves the stale records.
Confirming the problem
-
Connect to the primary's administrative shell using Secure Shell (SSH). For more information, see Accessing the administrative shell (SSH).
-
List the registered Git servers. Note the UUID after
git-server-in each row.ghe-spokesctl server show -
Run the following command on the primary and every replica in the configuration to get each node's UUID.
cat /data/user/common/uuid -
Compare the two lists. A Git server record is stale if its UUID does not match any current node's UUID.
Before you remove a stale record, make sure the node is permanently retired. All of the following must be true:
- The node is not the primary.
- The node is not part of the active configuration.
- You do not plan to reattach the node.
A rebuilt appliance can have a new UUID even if you reuse the same virtual machine.
An unreachable appliance, or a node missing from the configuration, is not enough on its own to prove that the node is retired.
Resolving the problem
This procedure removes the record for a permanently retired node. To remove a replica that is still reachable and configured, follow the replica removal procedure instead. See Removing a high availability replica.
Warning
Removing a node's UUID deletes the node's database entries. Never remove the primary or a replica you still need.
On versions 3.18 and later, use ghe-repl-decommission only after a successful failover or with guidance from GitHub Support.
Schedule a change window before you begin.
-
Take a backup of your GitHub Enterprise Server instance. For more information, see Creating and monitoring backups.
-
If the former appliance still exists, shut it down or delete it, so it can't reconnect later.
-
Connect to the primary's administrative shell using SSH.
-
Double-check that the UUID you identified belongs to the retired node. The UUID must not include the
git-server-prefix. -
Remove the retired node. Replace
UUIDwith the UUID you confirmed.If you're running 3.18 or later, use
ghe-repl-decommissionand confirm when prompted. For more information, see Command-line utilities.ghe-repl-decommission UUIDOn earlier releases, use
ghe-repl-teardownwith the-uoption. It can start removal without asking for confirmation. From 3.18,ghe-repl-teardownno longer supports-u.ghe-repl-teardown -u UUIDghe-repl-decommissionrefuses the current node and any UUID that is still in the active configuration. If either removal command refuses the UUID or reports an error, stop. Don't try to work around it. See Contacting GitHub Support. -
On the primary, list the Git servers again. Confirm that only the retired node was removed.
ghe-spokesctl server showIf the retired node is still listed, or a current node is missing, stop. Don't run the removal command again. See Contacting GitHub Support.
-
On each replica, check replication status.
ghe-repl-status -vv
Removing a stale record doesn't guarantee that other checksum, copy, or cleanup warnings will clear. If warnings remain, contact GitHub Support before making any other change.
Preventing recurrence
After a successful failover, decommission the UUID of each appliance that you have permanently retired and don't plan to reattach. For more information, see Initiating a failover to your replica appliance.
Contacting GitHub Support
Contact GitHub Support rather than continuing if any of the following apply:
- The command refuses the UUID or reports an error.
- The Git server list is wrong after you remove the record.
- Replication warnings remain after you remove the record.
- You are unsure whether a node is retired.
For more information, see Creating a support ticket.
When you open a ticket, include the output of ghe-repl-status -vv from each replica. Attaching a support bundle also helps GitHub Support diagnose the problem faster. For more information, see Providing data to GitHub Support.