Fencing and quorum
Fencing (isolation) disconnects a failed node from the disks before another node opens its pools. Quorum is the majority rule by which the nodes elect one leader; only the leader decides where a pool runs. Together they prevent two nodes from writing to the same pool at the same time, which would corrupt the pool data.
Purpose of fencing and quorum
A storage pool can be open on only one node. A node that stopped responding may still be running: for example, it may have hung or lost its cluster network connection but still be writing to the pool. Therefore, before the cluster opens the pools of such a node on another node, it disconnects the node from the disks. To prevent the two parts of the cluster from moving pools independently when the network splits, one leader elected by the majority makes the decisions.
Given the choice between pool downtime and the risk of two nodes writing to the same pool, the cluster chooses downtime: if fencing the node fails, the pools remain unavailable.
Quorum
- The leader sends a heartbeat every 200 ms. If there is no heartbeat for 5–6 seconds, the nodes elect a new leader.
- Votes. A node becomes the leader if at least half of the other nodes, rounded down, voted for it. A leader that loses connection with that many nodes steps down.
- Without a leader, pools stay where they were running and continue to serve data requests. But no pool fails over, and Center cannot start, stop or transfer a pool: the leader holds the address that Center uses to reach the cluster manager.
| Nodes in the cluster | The leader needs online, including itself | The leader survives the failure of |
|---|---|---|
| 4 | 2 | 2 nodes |
| 5 | 3 | 2 nodes |
| 7 | 4 | 3 nodes |
| 9 | 5 | 4 nodes |
Pools, however, survive the failure of no more nodes than the pool redundancy: 1 or 2 in the recommended configurations. On 9 nodes, quorum survives the failure of four nodes, but pool data does not: Cluster storage (SDS).
A preserved leader does not guarantee that the pools fail over: if two nodes fail at the same time, fencing may not complete — Node failure.
Center calculates the failover tolerance more strictly: more than half of the nodes must remain in service. Therefore, a cluster of 4 nodes tolerates one node, even with pool redundancy 2. Center keeps a memory reserve for this tolerance — Memory reserve for node failures.
Even number of nodes. On 4 nodes, choose redundancy 1 (N+1); redundancy 2 (N+2) is for 5 or more nodes: Storage redundancy and disk recovery. If the cluster network splits into two equal parts, contact vStack support immediately.
Node fencing
The disks of each node are visible to the other nodes over the storage network. To fence a node, each running node:
- turns off the port through which it serves its disks to that node;
- disconnects from the disks of that node.
If the node is actually still running, it loses access to the disks of its neighbors and cannot keep working with the pool. Its pools open on other nodes without its disks, with incomplete redundancy.
- Confirmation. Pools fail over only when all running nodes confirm the fencing. Each node makes up to 5 attempts with a 2-second pause. A node that has itself already been declared failed does not take part in fencing: the cluster does not wait for its confirmation.
- Failure. If at least one node does not confirm, the cluster does not fail over the pools. They remain with the failed node until it returns or support resolves the issue.
- Node return. The neighbors serve their disks to the node again, connect to its disks and return them to the pools. If the connection is not restored within a few seconds, the disks stay outside the pool, and the pool is in Warning. If the ports cannot be turned back on, the cluster records in the log that this must be fixed manually; support performs the fix.
What you see
In the Center web interface, quorum and fencing are visible through their consequences:
- the failed node has Critical in Node health;
- until fencing completes, the Current node of its pools is the failed node;
- without a leader, actions with pools and nodes in the web interface fail with a cluster manager connection error — Cluster web interface and API are unavailable.
On a node, the vstack-cluster status command shows the state of nodes and services; the cluster-management service runs on the leader. The command only reads the state.
Limitations
- Power is not turned off. The cluster does not power off a node through the baseboard management controller (BMC): fencing works only through the storage network.
- A hung node delays fencing: if it responds over the network but does not work, each attempt waits up to 5 minutes for a response.
- Two failures in a row. While the cluster is fencing the first node, a failure of a second node interrupts the fencing of the first one. The cluster often cannot resolve this situation by itself — contact vStack support: Two nodes failed.
What not to do
- Do not manually turn on storage ports and connections to a fenced node. The node would regain access to the disks of pools that are already open on other nodes.
- Do not change the cluster manager configuration on the nodes. Fencing depends on it: with a wrong setting, a node failure can end with two nodes writing to the same pool.
- Do not restart the cluster manager on several nodes in a row. The cluster may lose quorum; in addition, each restart moves the pools of the node to other nodes.
- Do not disable nodes or remove them from the cluster with the cluster utility during a failure: this changes the number of votes and the pool placement. For planned maintenance, drain the node using maintenance mode — Put a node into maintenance mode.
- Do not power on a fenced node without approval from support. The fencing may have been justified, and the return of the node starts returning its disks to the pools.
- Do not import a pool manually. Fencing protects only against decisions of the cluster, not against a manual command.