ClusterLabs / anvil

The Anvil! Intelligent Availability™ Platform, mark 3
5 stars 6 forks source link

Use DC to determine where pcs commands run #412

Open digimer opened 11 months ago

digimer commented 11 months ago

pcs doesn't like being called in parallel, from anywhere. So use the DC;

[root@an-a01n01 ~]# pcs cluster status
Cluster Status:
 Cluster Summary:
   * Stack: corosync (Pacemaker is running)
   * Current DC: an-a01n02 (version 2.1.6-2.el8-6fdc9deea29) - partition with quorum

Which appears to be dc-uuid in the CIB;

<cib crm_feature_set="3.17.4" validate-with="pacemaker-3.9" epoch="25" num_updates="0" admin_epoch="0" cib-last-written="Wed Aug  9 03:16:08 2023" update-origin="an-a01n01" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="2">

Translate the node 1 to host name and run all pcs calls (other than status) there using the alteeve-pcs-wrapper.

digimer commented 11 months ago
if hostname != dc-uuid-name; then
   echo not for us
fi
if [ "$1" = "status" ]; then
   pcs $@
   return $?
 fi
flock....
digimer commented 11 months ago

Should be if [ "$1" == "status" ]; then

digimer commented 11 months ago

Local serialization is now in place in pr#408. Can now successfully recover multiple servers simultaneously without breaking the updates to the constraints. This means servers no longer migrate when the peer recovers.

If testing proves this successful, please change this ticket to pre-GA for the serialization across nodes component.

fabbione commented 11 months ago

Should be if [ "$1" == "status" ]; then

== is a bash´ism. Not a big deal but the correct version is with one =.