summaryrefslogtreecommitdiff
path: root/ctdb/server
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2018-02-14 14:27:32 +1100
committerAmitay Isaacs <amitay@samba.org>2018-10-08 02:46:20 +0200
commit040401ca3abfa266261130f6c5ae4e9718f19cd7 (patch)
tree3f7d06a1d0f4c926032b190de9e0f0051f5bd001 /ctdb/server
parent71896fddf10a92237d332779ccbb26c059caa649 (diff)
downloadsamba-040401ca3abfa266261130f6c5ae4e9718f19cd7.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>
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 fc64037b95f..77c614df643 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"));