summaryrefslogtreecommitdiff
path: root/ctdb/server
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-06-15 06:01:52 +1000
committerKarolin Seeger <kseeger@samba.org>2018-07-09 12:55:26 +0200
commit99d490d3ecfbd51e60680dd20bb6a2b9d13abf7d (patch)
tree2be47384f1f3250e8670aafffbaf234cc50d6a0f /ctdb/server
parent9352dd5ea0d441b4794d11aaced76e1457a4b61c (diff)
downloadsamba-99d490d3ecfbd51e60680dd20bb6a2b9d13abf7d.tar.gz
ctdb-server: Rename CTDB_BROADCAST_VNNMAP -> CTDB_BROADCAST_ACTIVE
This broadcast is misnamed. Both places where this type of broadcast is used expect the broadcast to go to all active nodes. Make the corresponding change to the semantics in the daemon by sending to all active nodes. There is a mismatch between the ideas of VNN map and active nodes. A node that is not in the VNN map but is active can still host database records. These were the same until the LMASTER capability was introduced and then the logic was not updated. The only place where the VNN map is relevant is when finding the location master of a record in the migration code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13499 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 36938bfdd075a174daecb466085702adfe6a6c09)
Diffstat (limited to 'ctdb/server')
-rw-r--r--ctdb/server/ctdb_control.c4
-rw-r--r--ctdb/server/ctdb_ltdb_server.c12
-rw-r--r--ctdb/server/ctdb_server.c16
-rw-r--r--ctdb/server/ctdb_traverse.c4
4 files changed, 23 insertions, 13 deletions
diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c
index 6835ccaf063..f7a8b6b6e65 100644
--- a/ctdb/server/ctdb_control.c
+++ b/ctdb/server/ctdb_control.c
@@ -859,7 +859,7 @@ int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
return -1;
}
- if (((destnode == CTDB_BROADCAST_VNNMAP) ||
+ if (((destnode == CTDB_BROADCAST_ACTIVE) ||
(destnode == CTDB_BROADCAST_ALL) ||
(destnode == CTDB_BROADCAST_CONNECTED)) &&
!(flags & CTDB_CTRL_FLAG_NOREPLY)) {
@@ -867,7 +867,7 @@ int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
return -1;
}
- if (destnode != CTDB_BROADCAST_VNNMAP &&
+ if (destnode != CTDB_BROADCAST_ACTIVE &&
destnode != CTDB_BROADCAST_ALL &&
destnode != CTDB_BROADCAST_CONNECTED &&
(!ctdb_validate_pnn(ctdb, destnode) ||
diff --git a/ctdb/server/ctdb_ltdb_server.c b/ctdb/server/ctdb_ltdb_server.c
index c199aac2d1d..1962f854683 100644
--- a/ctdb/server/ctdb_ltdb_server.c
+++ b/ctdb/server/ctdb_ltdb_server.c
@@ -1535,9 +1535,15 @@ static void ctdb_ltdb_seqnum_check(struct tevent_context *ev,
TDB_DATA data;
data.dptr = (uint8_t *)&ctdb_db->db_id;
data.dsize = sizeof(uint32_t);
- ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_VNNMAP, 0,
- CTDB_CONTROL_UPDATE_SEQNUM, 0, CTDB_CTRL_FLAG_NOREPLY,
- data, NULL, NULL);
+ ctdb_daemon_send_control(ctdb,
+ CTDB_BROADCAST_ACTIVE,
+ 0,
+ CTDB_CONTROL_UPDATE_SEQNUM,
+ 0,
+ CTDB_CTRL_FLAG_NOREPLY,
+ data,
+ NULL,
+ NULL);
}
ctdb_db->seqnum = new_seqnum;
diff --git a/ctdb/server/ctdb_server.c b/ctdb/server/ctdb_server.c
index 900674132ac..93256ecfd58 100644
--- a/ctdb/server/ctdb_server.c
+++ b/ctdb/server/ctdb_server.c
@@ -389,14 +389,18 @@ static void ctdb_broadcast_packet_all(struct ctdb_context *ctdb,
}
/*
- broadcast a packet to all nodes in the current vnnmap
+ broadcast a packet to all active nodes
*/
-static void ctdb_broadcast_packet_vnnmap(struct ctdb_context *ctdb,
+static void ctdb_broadcast_packet_active(struct ctdb_context *ctdb,
struct ctdb_req_header *hdr)
{
int i;
- for (i=0;i<ctdb->vnn_map->size;i++) {
- hdr->destnode = ctdb->vnn_map->map[i];
+ for (i = 0; i < ctdb->num_nodes; i++) {
+ if (ctdb->nodes[i]->flags & NODE_FLAGS_INACTIVE) {
+ continue;
+ }
+
+ hdr->destnode = ctdb->nodes[i]->pnn;
ctdb_queue_packet(ctdb, hdr);
}
}
@@ -430,8 +434,8 @@ void ctdb_queue_packet(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
case CTDB_BROADCAST_ALL:
ctdb_broadcast_packet_all(ctdb, hdr);
return;
- case CTDB_BROADCAST_VNNMAP:
- ctdb_broadcast_packet_vnnmap(ctdb, hdr);
+ case CTDB_BROADCAST_ACTIVE:
+ ctdb_broadcast_packet_active(ctdb, hdr);
return;
case CTDB_BROADCAST_CONNECTED:
ctdb_broadcast_packet_connected(ctdb, hdr);
diff --git a/ctdb/server/ctdb_traverse.c b/ctdb/server/ctdb_traverse.c
index 04a41138a72..5ea19709599 100644
--- a/ctdb/server/ctdb_traverse.c
+++ b/ctdb/server/ctdb_traverse.c
@@ -387,8 +387,8 @@ static struct ctdb_traverse_all_handle *ctdb_daemon_traverse_all(struct ctdb_db_
}
if (ctdb_db_volatile(ctdb_db)) {
- /* normal database, traverse all nodes */
- destination = CTDB_BROADCAST_VNNMAP;
+ /* volatile database, traverse all active nodes */
+ destination = CTDB_BROADCAST_ACTIVE;
} else {
int i;
/* persistent database, traverse one node, preferably