ctdb_req_dmaster from non-master
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 18 Feb 2011 00:21:19 +0000 (11:21 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 18 Feb 2011 00:21:19 +0000 (11:21 +1100)
If we find a situatior where we get a stray packet with the wrong
dmaster, dont suicide with ctdb_fatal() since this is too disruptive.
Just drop the stray packet and force a recovery to make sure all is good again.

CQ S1022004

server/ctdb_call.c

index d6c08666a6c28fc22403f3745dc48853daf1eeaa..be6e8f93d2d1f1242975f4b065337fc0753f2231 100644 (file)
@@ -369,7 +369,9 @@ void ctdb_request_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
                         (unsigned long long)c->rsn, (unsigned long long)header.rsn, c->hdr.reqid,
                         (key.dsize >= 4)?(*(uint32_t *)key.dptr):0));
                if (header.rsn != 0 || header.dmaster != ctdb->pnn) {
-                       ctdb_fatal(ctdb, "ctdb_req_dmaster from non-master");
+                       DEBUG(DEBUG_ERR,("ctdb_req_dmaster from non-master. Force a recovery.\n"));
+
+                       ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
                        return;
                }
        }