diff options
author | Volker Lendecke <vl@samba.org> | 2017-07-25 17:10:27 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2017-12-05 00:56:12 +0100 |
commit | 2fdde4a07a4e7f28cd9cbd0ac9a0bae3fa748522 (patch) | |
tree | 1e473d7655be5cbe52e8251d428e96da03732692 /source3 | |
parent | 84fd51ba6103957f64021e6543314bcbe1f389af (diff) | |
download | samba-2fdde4a07a4e7f28cd9cbd0ac9a0bae3fa748522.tar.gz |
messaging: Always register CTDB_SRVID_SAMBA_PROCESS
This will be used to broadcast to all processes, avoiding the costly
traverse of serverid.tdb.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/ctdb_srvids.h | 6 | ||||
-rw-r--r-- | source3/lib/messages_ctdb.c | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/source3/include/ctdb_srvids.h b/source3/include/ctdb_srvids.h index 500b5069e67..b51a4585060 100644 --- a/source3/include/ctdb_srvids.h +++ b/source3/include/ctdb_srvids.h @@ -38,3 +38,9 @@ * locally according to the non-clustered local notify.tdb */ #define CTDB_SRVID_SAMBA_NOTIFY_PROXY 0xFE00000000000001LL + +/* + * SRVID for all processes that come from Samba. Used to be + * MSG_SRVID_SAMBA in the past. Now used for message_send_all. + */ +#define CTDB_SRVID_SAMBA_PROCESS 0xFE00000000000002LL diff --git a/source3/lib/messages_ctdb.c b/source3/lib/messages_ctdb.c index a2a7c215f23..66b9f55d256 100644 --- a/source3/lib/messages_ctdb.c +++ b/source3/lib/messages_ctdb.c @@ -26,6 +26,7 @@ #include "lib/messages_util.h" #include "ctdbd_conn.h" #include "lib/cluster_support.h" +#include "ctdb_srvids.h" struct messaging_ctdb_context; @@ -111,6 +112,14 @@ int messaging_ctdb_init(const char *sockname, int timeout, uint64_t unique_id, goto fail; } + ret = register_with_ctdbd(ctx->conn, CTDB_SRVID_SAMBA_PROCESS, + messaging_ctdb_recv, ctx); + if (ret != 0) { + DBG_DEBUG("register_with_ctdbd returned %s (%d)\n", + strerror(ret), ret); + goto fail; + } + ret = register_with_ctdbd(ctx->conn, unique_id, NULL, NULL); if (ret != 0) { DBG_DEBUG("register_with_ctdbd returned %s (%d)\n", |