summaryrefslogtreecommitdiff
path: root/ctdb/server
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2018-02-14 14:27:32 +1100
committerKarolin Seeger <kseeger@samba.org>2018-10-09 11:29:25 +0200
commitffc84e1c9a00614430d5f021a98c45289d3b0e0c (patch)
tree696744fef07c969d830d16a02736b5852a798dc1 /ctdb/server
parenta363e0ce25b5a988cbe4c93ac09c9335e4552413 (diff)
downloadsamba-ffc84e1c9a00614430d5f021a98c45289d3b0e0c.tar.gz
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 <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 040401ca3abfa266261130f6c5ae4e9718f19cd7)
Diffstat (limited to 'ctdb/server')
-rw-r--r--ctdb/server/ctdb_recover.c12
1 files changed, 12 insertions, 0 deletions
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"));