1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

ctdb-recoverd: Push flags for a node if any remote node disagrees

This will usually happen if flags on the node in question change, so
keeping the code simple and pushing to all nodes won't hurt.  When all
nodes come up there might be differences in connected nodes, causing
such "fix ups".  Receiving nodes will ignore no-op pushes.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14784
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 8305f6a7f132f03b0bbdb26692b7491fd3f6c24f)
This commit is contained in:
Martin Schwenke 2021-07-11 22:17:08 +10:00 committed by Jule Anger
parent 2cc4b917f7
commit c01d48d7a5

View File

@ -555,13 +555,20 @@ static int update_flags(struct ctdb_recoverd *rec,
uint32_t local_flags = nodemap->nodes[j].flags;
uint32_t remote_pnn = nodemap->nodes[j].pnn;
uint32_t remote_flags;
unsigned int i;
int ret;
if (local_flags & NODE_FLAGS_DISCONNECTED) {
continue;
}
if (remote_pnn == ctdb->pnn) {
continue;
/*
* No remote nodemap for this node since this
* is the local nodemap. However, still need
* to check this against the remote nodes and
* push it if they are out-of-date.
*/
goto compare_remotes;
}
remote_nodemap = remote_nodemaps[j];
@ -582,6 +589,26 @@ static int update_flags(struct ctdb_recoverd *rec,
goto push;
}
compare_remotes:
for (i = 0; i < nodemap->num; i++) {
if (i == j) {
continue;
}
if (nodemap->nodes[i].flags & NODE_FLAGS_DISCONNECTED) {
continue;
}
if (nodemap->nodes[i].pnn == ctdb->pnn) {
continue;
}
remote_nodemap = remote_nodemaps[i];
remote_flags = remote_nodemap->nodes[j].flags;
if (local_flags != remote_flags) {
goto push;
}
}
continue;
push: