summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-24 09:05:06 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-24 13:43:33 +0200
commit9529301503c043aaf8d3c39d3b0f014aaa0cc123 (patch)
treee916c0f653ec8200afc821cdcc0bd51d0fb04de0
parent18c6757dbb7ee0e6a4be15b0f2a3fec1f94ba518 (diff)
downloadsamba-9529301503c043aaf8d3c39d3b0f014aaa0cc123.tar.gz
samba-9529301503c043aaf8d3c39d3b0f014aaa0cc123.tar.bz2
samba-9529301503c043aaf8d3c39d3b0f014aaa0cc123.zip
s3:lib: readd the CTDB_CONTROL_CHECK_SRVIDS optimization to serverids_exist()
metze
-rw-r--r--source3/lib/serverid.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index 3392e83c89..cb49520564 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -340,6 +340,51 @@ bool serverids_exist(const struct server_id *ids, int num_ids, bool *results)
remote_num += 1;
}
+#ifdef HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL
+ if (remote_num != 0) {
+ int old_remote_num = remote_num;
+
+ remote_num = 0;
+ todo_num = 0;
+
+ for (t=0; t<old_remote_num; t++) {
+ idx = remote_idx[t];
+
+ if (ids[idx].unique_id == SERVERID_UNIQUE_ID_NOT_TO_VERIFY) {
+ remote_idx[remote_num] = idx;
+ remote_num += 1;
+ continue;
+ }
+
+ todo_idx[todo_num] = idx;
+ todo_ids[todo_num] = ids[idx];
+ todo_results[todo_num] = false;
+ todo_num += 1;
+ }
+
+ /*
+ * Note: this only uses CTDB_CONTROL_CHECK_SRVIDS
+ * to verify that the server_id still exists,
+ * which means only the server_id.unique_id and
+ * server_id.vnn are verified, while server_id.pid
+ * is not verified at all.
+ *
+ * TODO: do we want to verify server_id.pid somehow?
+ */
+ if (!ctdb_serverids_exist(messaging_ctdbd_connection(),
+ todo_ids, todo_num, todo_results))
+ {
+ goto fail;
+ }
+
+ for (t=0; t<todo_num; t++) {
+ idx = todo_idx[t];
+
+ results[idx] = todo_results[t];
+ }
+ }
+#endif
+
if (remote_num != 0) {
todo_num = 0;