Commit 285d31d
committed
CA-403379: pre-flight cluster_host state before pool-ha-enable
When the chosen HA cluster_stack is corosync (i.e. for a gfs2 heartbeat
SR) every pool host must have an enabled, joined cluster_host on the
matching cluster stack, and this host must currently be quorate.
Without this preflight, that failure surfaces much later inside
Xha_statefile.check_sr_can_host_statefile with the misleading
SR_NO_PBDS error from pool-ha-enable (CA-417077 / TC7509).
This change adds a per-host preflight in Xapi_ha.enable that reuses
the existing NO_COMPATIBLE_CLUSTER_HOST, CLUSTERING_DISABLED and
CLUSTER_HOST_NOT_JOINED errors so the caller can pinpoint exactly
which host is the problem.
The preflight runs BEFORE the cluster_stack is persisted to the pool
DB and localdb, matching the pattern of the existing host_offline
check, so a failed precondition does not leak ha_cluster_stack into
the pool state.
The final assert_cluster_host_quorate call queries xapi-clusterd
diagnostics directly rather than reading the Cluster_host.live DB
field, which the corosync_notifyd watcher only updates asynchronously
and which is reset to false for all hosts on any transient quorum
blip.
Signed-off-by: Lunfan Zhang[Lunfan.Zhang] <Lunfan.Zhang@cloud.com>1 parent 5f6406f commit 285d31d
2 files changed
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1908 | 1908 | | |
1909 | 1909 | | |
1910 | 1910 | | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
1911 | 1955 | | |
1912 | 1956 | | |
1913 | 1957 | | |
| |||
0 commit comments