]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb will now verify that the generation id for all CTDB_REQ_CALLs that
authorRonnie Sahlberg <sahlberg@ronnie>
Fri, 27 Apr 2007 15:48:31 +0000 (01:48 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Fri, 27 Apr 2007 15:48:31 +0000 (01:48 +1000)
it receives from remote nodes with its own generation number.

if the generation id do not match the daemon will just discard the
packet completely.
this will require that clients such as samba3 will have to be aware that
calls it sends to remote nodes may get lost and will have to resend the
requests after a timeout.

during cluster recovery/reconfiguration the generation nnumbers will be
changing and this can be used to prevent nodes that are still in the
"old" instance from talking to nodes that belong to the new generation
instance

(This used to be ctdb commit 4c197f1cbfdd5f65af9c059aae2b4508ebd0cd34)

ctdb/common/ctdb.c

index c13bf7d0e5d9f9bb257300d0de0b99a07b4098e3..4b47a6e2a1d7d78ace344466f06e6eed515c2e5a 100644 (file)
@@ -238,6 +238,20 @@ void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t length)
 
        switch (hdr->operation) {
        case CTDB_REQ_CALL:
+               /* verify that the remote node that sent us the call
+                  is running in the same generation instance as this node
+               */
+               if (ctdb->vnn_map->generation != hdr->generation) {
+                       DEBUG(0,(__location__ " ctdb request %d of type"
+                               " %d length %d from node %d to %d had an"
+                               " invalid generation id:%d while our"
+                               " generation id is:%d\n", 
+                               hdr->reqid, hdr->operation, hdr->length, 
+                               hdr->srcnode, hdr->destnode, 
+                               ctdb->vnn_map->generation, 
+                               hdr->generation));
+                       break;
+               }
                ctdb->status.count.req_call++;
                ctdb_request_call(ctdb, hdr);
                break;