diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 987502ef008..d300d896551 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -24,19 +24,12 @@ #include /* - recovery daemon memdump reply address + * Structure to support SRVID requests and replies */ -struct rd_memdump_reply { - uint32_t pnn; - uint64_t srvid; -}; - -/* - description for a TAKEOVER_RUN message reply address - */ -struct takeover_run_reply { +struct srvid_request { uint32_t pnn; uint64_t srvid; + uint32_t data; }; /* diff --git a/ctdb/server/ctdb_monitor.c b/ctdb/server/ctdb_monitor.c index c23477d1641..acd68c834da 100644 --- a/ctdb/server/ctdb_monitor.c +++ b/ctdb/server/ctdb_monitor.c @@ -113,7 +113,7 @@ static void ctdb_health_callback(struct ctdb_context *ctdb, int status, void *p) uint32_t next_interval; int ret; TDB_DATA rddata; - struct takeover_run_reply rd; + struct srvid_request rd; const char *state_str = NULL; c.pnn = ctdb->pnn; diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 2d01e050ab8..ef80defa891 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -40,7 +40,7 @@ struct reloadips_all_reply *reload_all_ips_request = NULL; */ struct ip_reallocate_list { struct ip_reallocate_list *next; - struct rd_memdump_reply *rd; + struct srvid_request *rd; }; struct ctdb_banning_state { @@ -2162,14 +2162,14 @@ static void mem_dump_handler(struct ctdb_context *ctdb, uint64_t srvid, TALLOC_CTX *tmp_ctx = talloc_new(ctdb); TDB_DATA *dump; int ret; - struct rd_memdump_reply *rd; + struct srvid_request *rd; - if (data.dsize != sizeof(struct rd_memdump_reply)) { + if (data.dsize != sizeof(struct srvid_request)) { DEBUG(DEBUG_ERR, (__location__ " Wrong size of return address.\n")); talloc_free(tmp_ctx); return; } - rd = (struct rd_memdump_reply *)data.dptr; + rd = (struct srvid_request *)data.dptr; dump = talloc_zero(tmp_ctx, TDB_DATA); if (dump == NULL) { @@ -2441,9 +2441,9 @@ reload_all_ips(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, struct ctdb /* - handler for ip reallocate, just add it to the list of callers and + handler for ip reallocate, just add it to the list of requests and handle this later in the monitor_cluster loop so we do not recurse - with other callers to takeover_run() + with other requests to takeover_run() */ static void ip_reallocate_handler(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA data, void *private_data) @@ -2451,7 +2451,7 @@ static void ip_reallocate_handler(struct ctdb_context *ctdb, uint64_t srvid, struct ctdb_recoverd *rec = talloc_get_type(private_data, struct ctdb_recoverd); struct ip_reallocate_list *caller; - if (data.dsize != sizeof(struct rd_memdump_reply)) { + if (data.dsize != sizeof(struct srvid_request)) { DEBUG(DEBUG_ERR, (__location__ " Wrong size of return address.\n")); return; } @@ -2464,7 +2464,7 @@ static void ip_reallocate_handler(struct ctdb_context *ctdb, uint64_t srvid, caller = talloc(rec->ip_reallocate_ctx, struct ip_reallocate_list); CTDB_NO_MEMORY_FATAL(ctdb, caller); - caller->rd = (struct rd_memdump_reply *)talloc_steal(caller, data.dptr); + caller->rd = (struct srvid_request *)talloc_steal(caller, data.dptr); caller->next = rec->reallocate_callers; rec->reallocate_callers = caller; @@ -3112,7 +3112,7 @@ static int verify_local_ip_allocation(struct ctdb_context *ctdb, struct ctdb_rec } if (need_takeover_run) { - struct takeover_run_reply rd; + struct srvid_request rd; TDB_DATA data; DEBUG(DEBUG_CRIT,("Trigger takeoverrun\n")); diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index 6ca340770fb..db4b1d31f23 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -2005,7 +2005,7 @@ static int ipreallocate(struct ctdb_context *ctdb) { int ret; TDB_DATA data; - struct takeover_run_reply rd; + struct srvid_request rd; struct timeval tv; /* Time ticks to enable timeouts to be processed */ @@ -2015,6 +2015,7 @@ static int ipreallocate(struct ctdb_context *ctdb) rd.pnn = ctdb_get_pnn(ctdb); rd.srvid = getpid(); + rd.data = 0; /* Register message port for reply from recovery master */ ctdb_client_set_message_handler(ctdb, rd.srvid, ip_reallocate_handler, NULL); @@ -5713,7 +5714,7 @@ static int control_rddumpmemory(struct ctdb_context *ctdb, int argc, const char { int ret; TDB_DATA data; - struct rd_memdump_reply rd; + struct srvid_request rd; rd.pnn = ctdb_get_pnn(ctdb); rd.srvid = getpid();