You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/instanceha_architecture.md
+76-1Lines changed: 76 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2122,7 +2122,7 @@ spec:
2122
2122
serviceAccountName: instanceha-instanceha
2123
2123
securityContext:
2124
2124
fsGroup: 42401
2125
-
terminationGracePeriodSeconds: 30
2125
+
terminationGracePeriodSeconds: 45
2126
2126
containers:
2127
2127
- name: instanceha
2128
2128
image: <resolved from infra-instanceha-config ConfigMap or RELATED_IMAGE env var>
@@ -2218,6 +2218,52 @@ spec:
2218
2218
2219
2219
---
2220
2220
2221
+
## Small Cluster Tuning
2222
+
2223
+
InstanceHA works on clusters of any size, but the default safety thresholds are tuned for medium-to-large deployments. On clusters with 3–5 compute nodes, the percentage-based safety gates can block evacuation during legitimate multi-node failures because a small absolute number of failures translates to a large percentage.
Setting `THRESHOLD: 100` disables the global percentage check entirely. This is safe because:
2247
+
1. Heartbeat detection (`CHECK_HEARTBEAT`) provides the primary protection against fencing during network partitions
2248
+
2. The K8s API reachability gate (gate 1) suppresses fencing if the pod itself loses network connectivity
2249
+
3. Per-aggregate thresholds (if configured) still apply as an absolute count, which is better suited to small clusters
2250
+
2251
+
If heartbeats are not deployed, a more conservative approach:
2252
+
2253
+
```yaml
2254
+
config:
2255
+
THRESHOLD: 67 # Allow up to 2/3 failure ratio
2256
+
```
2257
+
2258
+
### Why the Defaults Are Conservative
2259
+
2260
+
The default `THRESHOLD: 50` and `HEARTBEAT_CLIFF_THRESHOLD: 50` are deliberately conservative because:
2261
+
- False positives (unnecessary fencing) are more dangerous than false negatives (delayed evacuation)
2262
+
- On larger clusters, losing >50% of nodes simultaneously almost always indicates a network partition, not real failures
2263
+
- Small clusters are the exception, not the rule, in production OpenStack deployments
2264
+
2265
+
---
2266
+
2221
2267
## Configuration Options Reference
2222
2268
2223
2269
This section describes each configuration option in the `_config_map`, including its purpose, validation rules, usage in the codebase, and testing coverage.
@@ -2345,6 +2391,7 @@ config:
2345
2391
- Value of `0` blocks all evacuations (any failure percentage exceeds 0%)
2346
2392
- Value of `100` disables threshold checking (nothing can exceed 100%)
2347
2393
- Aggregate-aware calculation uses only evacuable hosts as denominator
2394
+
- **Small clusters**: On a 3-node cluster, 2 simultaneous failures = 66.7%, which exceeds the default 50%. On a 4-node cluster, 2 failures = 50% (not blocked, since the check is `>`). Operators of small clusters who expect multi-node failures should raise this value. See [Small Cluster Tuning](#small-cluster-tuning).
2348
2395
2349
2396
---
2350
2397
@@ -3008,6 +3055,34 @@ config:
3008
3055
3009
3056
---
3010
3057
3058
+
#### HEARTBEAT_CLIFF_THRESHOLD
3059
+
**Type**: Integer
3060
+
**Default**: `50`
3061
+
**Range**: `10-100` (percentage)
3062
+
3063
+
**Description**: Maximum percentage of heartbeat-active hosts that can disappear in a single poll cycle before cliff detection triggers. When the drop exceeds this threshold, InstanceHA assumes a listener-side network partition rather than simultaneous host failures and skips all fencing for that cycle.
3064
+
3065
+
**Usage**:
3066
+
- Evaluated in `_filter_reachable_hosts()` each poll cycle when `CHECK_HEARTBEAT` is enabled
3067
+
- Compares `heartbeat_previous_active_count` (previous cycle) against current active count
3068
+
- Only evaluated when the previous active count was >= 3 (avoids false triggers during startup ramp-up)
3069
+
3070
+
**Behavior**:
3071
+
- If drop percentage >= `HEARTBEAT_CLIFF_THRESHOLD`: skip all fencing this cycle, emit `HeartbeatCliff` K8s event (Warning)
3072
+
- Baseline count is preserved during a cliff event, so the cliff re-triggers on subsequent cycles until heartbeats recover
3073
+
- When no cliff is detected, update `heartbeat_previous_active_count` for the next cycle
3074
+
3075
+
**Small Cluster Considerations**: On a 3-node cluster with all nodes sending heartbeats, losing 2 nodes simultaneously causes a 66.7% drop — exceeding the default 50% threshold. This blocks fencing for that cycle. If simultaneous multi-node failures are expected (not partitions), raise this value (e.g., `100` to disable cliff detection entirely). See [Small Cluster Tuning](#small-cluster-tuning).
0 commit comments