From: Amitay Isaacs Date: Wed, 14 Feb 2018 03:27:32 +0000 (+1100) Subject: ctdb-daemon: Don't pull any records if records are invalidated X-Git-Tag: samba-4.8.8~146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffc84e1c9a00614430d5f021a98c45289d3b0e0c;p=thirdparty%2Fsamba.git ctdb-daemon: Don't pull any records if records are invalidated This avoids unnecessary work during recovery to pull records from nodes that were INACTIVE just before the recovery. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13641 Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke (cherry picked from commit 040401ca3abfa266261130f6c5ae4e9718f19cd7) --- diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c index f4cd5f64eee..06087bba266 100644 --- a/ctdb/server/ctdb_recover.c +++ b/ctdb/server/ctdb_recover.c @@ -279,6 +279,11 @@ int32_t ctdb_control_pull_db(struct ctdb_context *ctdb, TDB_DATA indata, TDB_DAT ctdb_db->db_name, ctdb_db->unhealthy_reason)); } + /* If the records are invalid, we are done */ + if (ctdb_db->invalid_records) { + goto done; + } + if (ctdb_lockdb_mark(ctdb_db) != 0) { DEBUG(DEBUG_ERR,(__location__ " Failed to get lock on entire db - failing\n")); return -1; @@ -293,6 +298,7 @@ int32_t ctdb_control_pull_db(struct ctdb_context *ctdb, TDB_DATA indata, TDB_DAT ctdb_lockdb_unmark(ctdb_db); +done: outdata->dptr = (uint8_t *)params.pulldata; outdata->dsize = params.len; @@ -388,6 +394,11 @@ int32_t ctdb_control_db_pull(struct ctdb_context *ctdb, state.srvid = pulldb_ext->srvid; state.num_records = 0; + /* If the records are invalid, we are done */ + if (ctdb_db->invalid_records) { + goto done; + } + if (ctdb_lockdb_mark(ctdb_db) != 0) { DEBUG(DEBUG_ERR, (__location__ " Failed to get lock on entire db - failing\n")); @@ -422,6 +433,7 @@ int32_t ctdb_control_db_pull(struct ctdb_context *ctdb, ctdb_lockdb_unmark(ctdb_db); +done: outdata->dptr = talloc_size(outdata, sizeof(uint32_t)); if (outdata->dptr == NULL) { DEBUG(DEBUG_ERR, (__location__ " Memory allocation error\n"));