From db12f3359b9fb666381385b3984a7bed72f37b3a Mon Sep 17 00:00:00 2001 From: Ronnie sahlberg Date: Thu, 19 Apr 2007 12:48:19 +1000 Subject: [PATCH] the checks for srcnode and destnode from the client are redundant since the daemon will sort these out itself before it sends the call of to either the local handler or a remote daemon (This used to be ctdb commit 9175d49ba1ce2af99907fa227b50d281f85c98ae) --- ctdb/common/ctdb_daemon.c | 12 ------------ ctdb/direct/ctdbd_test.c | 6 ++---- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/ctdb/common/ctdb_daemon.c b/ctdb/common/ctdb_daemon.c index 531cf448268..a3ad4448bfc 100644 --- a/ctdb/common/ctdb_daemon.c +++ b/ctdb/common/ctdb_daemon.c @@ -306,18 +306,6 @@ static void daemon_request_call_from_client(struct ctdb_client *client, struct daemon_call_state *dstate; struct ctdb_call *call; - /* check that the client filled in the correct vnn for the local node */ - if (ctdb_get_vnn(client->ctdb) != c->hdr.srcnode) { - DEBUG(0, (__location__ "Wrong srcnode in CTDB_REQ_CALL from client was:%d should be :%d\n", c->hdr.srcnode, ctdb_get_vnn(client->ctdb))); - return; - } - - /* verify that the destnode makes sense */ - if (c->hdr.destnode >= client->ctdb->num_nodes) { - DEBUG(0, (__location__ "Wrong dstnode in CTDB_REQ_CALL from client was:%d but there are only %d nodes in the cluster\n", c->hdr.destnode, client->ctdb->num_nodes)); - return; - } - ctdb_db = find_ctdb_db(client->ctdb, c->db_id); if (!ctdb_db) { DEBUG(0, (__location__ " Unknown database in request. db_id==0x%08x", diff --git a/ctdb/direct/ctdbd_test.c b/ctdb/direct/ctdbd_test.c index bd26376a0dd..00b9f967dfe 100644 --- a/ctdb/direct/ctdbd_test.c +++ b/ctdb/direct/ctdbd_test.c @@ -188,7 +188,7 @@ uint32_t ctdb_hash(const TDB_DATA *key) when the daemon has responded this node should be the dmaster (unless it has migrated off again) */ -void fetch_record(int fd, uint32_t db_id, TDB_DATA key, int thisnode, int destnode) +void fetch_record(int fd, uint32_t db_id, TDB_DATA key) { struct ctdb_req_call *req; struct ctdb_reply_call *rep; @@ -202,8 +202,6 @@ void fetch_record(int fd, uint32_t db_id, TDB_DATA key, int thisnode, int destno req->hdr.ctdb_magic = CTDB_MAGIC; req->hdr.ctdb_version = CTDB_VERSION; req->hdr.operation = CTDB_REQ_CALL; - req->hdr.destnode = destnode; - req->hdr.srcnode = thisnode; req->hdr.reqid = 1; req->flags = CTDB_IMMEDIATE_MIGRATION; @@ -298,7 +296,7 @@ int main(int argc, const char *argv[]) key.dsize=strlen((const char *)(key.dptr)); printf("fetch the test key:[%s]\n",key.dptr); - fetch_record(fd, db_id, key, 0, 1); + fetch_record(fd, db_id, key); printf("\n");