From: Martin Schwenke Date: Wed, 8 Dec 2021 23:33:17 +0000 (+1100) Subject: ctdb-recoverd: Add PNN to recovery daemon context X-Git-Tag: tdb-1.4.6~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dbe7cc85e41ce4f9163d8298ba9fb20052db894;p=thirdparty%2Fsamba.git ctdb-recoverd: Add PNN to recovery daemon context 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 Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 86752d67632..8e90860e1f8 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -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;