From: Amitay Isaacs Date: Tue, 19 Jul 2016 07:28:19 +0000 (+1000) Subject: ctdb-recoverd: Remove code that updates database priorities during recovery X-Git-Tag: tdb-1.3.10~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6693fa59dc33d8e0a19f537695dc071c5a16a761;p=thirdparty%2Fsamba.git ctdb-recoverd: Remove code that updates database priorities during recovery Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 4eeb4ce6ca4..d2338176073 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -447,42 +447,6 @@ static int set_recovery_mode(struct ctdb_context *ctdb, return 0; } -/* update all remote nodes to use the same db priority that we have - this can fail if the remove node has not yet been upgraded to - support this function, so we always return success and never fail - a recovery if this call fails. -*/ -static int update_db_priority_on_remote_nodes(struct ctdb_context *ctdb, - struct ctdb_node_map_old *nodemap, - uint32_t pnn, struct ctdb_dbid_map_old *dbmap, TALLOC_CTX *mem_ctx) -{ - int db; - - /* step through all local databases */ - for (db=0; dbnum;db++) { - struct ctdb_db_priority db_prio; - int ret; - - db_prio.db_id = dbmap->dbs[db].db_id; - ret = ctdb_ctrl_get_db_priority(ctdb, CONTROL_TIMEOUT(), CTDB_CURRENT_NODE, dbmap->dbs[db].db_id, &db_prio.priority); - if (ret != 0) { - DEBUG(DEBUG_ERR,(__location__ " Failed to read database priority from local node for db 0x%08x\n", dbmap->dbs[db].db_id)); - continue; - } - - DEBUG(DEBUG_INFO,("Update DB priority for db 0x%08x to %u\n", dbmap->dbs[db].db_id, db_prio.priority)); - - ret = ctdb_ctrl_set_db_priority(ctdb, CONTROL_TIMEOUT(), - CTDB_CURRENT_NODE, &db_prio); - if (ret != 0) { - DEBUG(DEBUG_ERR,(__location__ " Failed to set DB priority for 0x%08x\n", - db_prio.db_id)); - } - } - - return 0; -} - /* ensure all other nodes have attached to any databases that we have */ @@ -1367,13 +1331,6 @@ static int do_recovery(struct ctdb_recoverd *rec, } DEBUG(DEBUG_NOTICE, (__location__ " Recovery - created remote databases\n")); - /* update the database priority for all remote databases */ - ret = update_db_priority_on_remote_nodes(ctdb, nodemap, pnn, dbmap, mem_ctx); - if (ret != 0) { - DEBUG(DEBUG_ERR, (__location__ " Unable to set db priority on remote nodes\n")); - } - DEBUG(DEBUG_NOTICE, (__location__ " Recovery - updated db priority for all databases\n")); - /* Retrieve capabilities from all connected nodes */ ret = update_capabilities(rec, nodemap);