]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-recoverd: Add PNN to recovery daemon context
authorMartin Schwenke <martin@meltin.net>
Wed, 8 Dec 2021 23:33:17 +0000 (10:33 +1100)
committerMartin Schwenke <martins@samba.org>
Mon, 17 Jan 2022 10:21:32 +0000 (10:21 +0000)
This is currently referenced in a number of inconsistent
ways, including:

* pnn
* rec->ctdb->pnn
* ctdb->pnn
* ctdb_get_pnn(ctdb)
* ctdb_get_pnn(rec->ctdb)

The first of these always requires some thought about the context - is
this the node PNN or some other PNN (e.g. argument to function)?

The intention is to always use rec->pnn when referring to the recovery
daemon's PNN.

Doing this also reduces reliance on struct ctdb_context internals.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recoverd.c

index 86752d6763225d2a93d695823540bf7b38bcfc18..8e90860e1f89cc21f129447f945ba1381a84d3f4 100644 (file)
@@ -247,6 +247,7 @@ struct ctdb_recovery_lock_handle;
 struct ctdb_recoverd {
        struct ctdb_context *ctdb;
        uint32_t recmaster;
+       uint32_t pnn;
        uint32_t last_culprit_node;
        struct ctdb_node_map_old *nodemap;
        struct timeval priority_time;
@@ -2940,6 +2941,7 @@ static void monitor_cluster(struct ctdb_context *ctdb)
 
        rec->ctdb = ctdb;
        rec->recmaster = CTDB_UNKNOWN_PNN;
+       rec->pnn = ctdb_get_pnn(ctdb);
        rec->recovery_lock_handle = NULL;
        rec->helper_pid = -1;