Skip to main content

Enterprise Server 3.23 目前作为发布候选版本提供。

Skip to content

Git replication out of sync because of a retired node

A node that is no longer in your high availability configuration may still be registered as a Git server. If ghe-repl-status reports that Git replication is out of sync, you can confirm and remove the stale record.

Symptoms

On a replica, ghe-repl-status reports that Git replication is out of sync or behind. For more information, see 监视高可用性系统配置.

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-restore removes the stale records.

Confirming the problem

  1. Connect to the primary's administrative shell using Secure Shell (SSH). For more information, see 访问管理 shell (SSH).

  2. List the registered Git servers. Note the UUID after git-server- in each row.

    ghe-spokesctl server show
    
  3. Run the following command on the primary and every replica in the configuration to get each node's UUID.

    cat /data/user/common/uuid
    
  4. 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 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 支持.

Schedule a change window before you begin.

  1. Take a backup of 你的 GitHub Enterprise Server 实例. For more information, see 创建和监视备份.

  2. If the former appliance still exists, shut it down or delete it, so it can't reconnect later.

  3. Connect to the primary's administrative shell using SSH.

  4. Double-check that the UUID you identified belongs to the retired node. The UUID must not include the git-server- prefix.

  5. Remove the retired node. Replace UUID with the UUID you confirmed.

    If you're running 3.18 or later, use ghe-repl-decommission and confirm when prompted. For more information, see 命令行实用程序.

    ghe-repl-decommission UUID
    

    On earlier releases, use ghe-repl-teardown with the -u option. It can start removal without asking for confirmation. From 3.18, ghe-repl-teardown no longer supports -u.

    ghe-repl-teardown -u UUID
    

    ghe-repl-decommission refuses 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 支持.

  6. On the primary, list the Git servers again. Confirm that only the retired node was removed.

    ghe-spokesctl server show
    

    If the retired node is still listed, or a current node is missing, stop. Don't run the removal command again. See Contacting GitHub 支持.

  7. 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 支持 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 发起到副本设备的故障转移.

Contacting GitHub 支持

Contact GitHub 支持 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 创建支持工单.

When you open a ticket, include the output of ghe-repl-status -vv from each replica. Attaching a support bundle also helps GitHub 支持 diagnose the problem faster. For more information, see 向GitHub支持提供数据.

Further reading