1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

36 Commits

Author SHA1 Message Date
Volker Lendecke
f059585fe6 lib: Add "unique_id" to ctdbd_process_exists
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13042
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-09-26 09:37:13 +02:00
Volker Lendecke
7d244129cc messaging: Remove messages_ctdbd.c
Replaced by messages_ctdb.[ch]

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
af63c0b32d ctdb_conn: Use messaging_ctdb_connection
Replace messaging_ctdbd_connection

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
1cc970be02 dbwrap_ctdb: Use messaging_ctdbd_connection
With messages_ctdb, the global ctdb connection will change after fork.

Don't store the wrong parent connection across a fork. The alternative would
be to do a reinit on all dbwrap_ctdb databases, but that seems overkill
given that we only have one "standard" ctdb connection anyway.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
e26fa9980c messaging: Add messages_ctdb_ref
Modeled after messages_dgm_ref

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
5afdce0a6a messaging: Add messaging_ctdb_init/destroy
This models connecting to ctdb after the dgm code. The main point
is that we should never open more than more ctdb socket for messaging.

With more than one socket, we might end up with our pid registered with
ctdb on more than one socket. This could lead to memory overconsumption
in ctdb. ctdbd will eventually throw away messages, but they will take
up space unnecessarily.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
fdad620990 messages_ctdb: Handle async msgs for nested event contexts
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
bd1e26f00e messaging: Add messaging_ctdbd_register_tevent_context
We need to listen for the ctdb socket in nested event contexts

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
267645545f ctdbd_conn: Pass "ev" through ctdb connection callbacks
This prepares the same logic we've implemented in messages_dgm for clustering
that is used in 6d3c064f1a: We need to reply for messages from ctdb in nested
event contexts properly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-07-25 17:43:18 +02:00
Volker Lendecke
ce9e92c114 lib: Give messages_ctdbd.c its own header
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-21 03:15:07 +02:00
Ralph Boehme
2813b53e1a dbwrap_ctdb: implement parse_record_send()/recv()
This mainly works like the sync version, but calls ctdbd_parse_send/recv
instead.

We use one global ctdb connection that is used exclusively for async
requests.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2017-04-18 22:54:16 +02:00
Ralph Boehme
f991381356 s3-messaging/ctdb: add messaging_ctdbd_reinit()
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2016-07-11 20:05:06 +02:00
Volker Lendecke
46be182ccb dbwrap: Add "msg_ctx" to db_open_ctdb
Another step towards making ctdbd_conn.c independent of messages.c. No call to
ctdb_conn_msg_ctx() anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-05-17 13:18:31 +02:00
Volker Lendecke
3fe3226daa dbwrap_ctdb: Pass in ctdbd_connection
This removes one circular dependency of dbwrap_ctdb to messages.c: No call to
messaging_ctdbd_connection() anymore from dbwrap_ctdb.c.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-05-17 13:18:31 +02:00
Volker Lendecke
a1309d5321 ctdbd_conn: remove ctdb_processes_exist
The singular call was the only user. Remove the complex plural one. We can
always dig it up from git history if we need it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-05-17 13:18:31 +02:00
Volker Lendecke
678ad954e8 lib: Make messaging_ctdbd_init return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-07 23:54:06 +02:00
Volker Lendecke
6cc1e660ee lib: Make ctdbd_probe return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-07 23:54:06 +02:00
Volker Lendecke
a039463d82 lib: Make ctdbd_register_ips return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-07 23:54:06 +02:00
Volker Lendecke
fdfc7299a6 lib: Make ctdbd_messaging_send_iov return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-07 23:54:05 +02:00
Volker Lendecke
84ad1a1372 lib: Make register_with_ctdbd return 0/errno
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-07 23:54:05 +02:00
Volker Lendecke
97bb100a76 lib: Pass sockname and timeout to ctdbd_probe()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Oct  3 03:04:39 CEST 2015 on sn-devel-104
2015-10-03 03:04:39 +02:00
Volker Lendecke
025fb48360 lib: Move lp_ctdbd_socket() to cluster_support.c
There we have a #ifdef CTDB_SOCKET anyway

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-03 00:01:11 +02:00
Volker Lendecke
620b7467ad lib: Remove ctdb_serverids_exist
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
b542ce7db3 lib: Use messaging_dgm_get_unique in serverid_exists
This is a relevant change: I was experimenting with
server_id_db_set_exclusive() in "net" and got failures all over the
place. The main reason was that "net" by default does not do a
serverid_register. With messaging_dgm we have the process' unique
id available via the lockfile contents. Using open/read/close is a
bit slower than local tdb access, but this version is safe for all
processes which have done messaging_init()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30 23:51:13 +02:00
Volker Lendecke
539125c99d ctdbd_conn: Move release_ip handling into process.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Jul 14 09:56:25 CEST 2015 on sn-devel-104
2015-07-14 09:56:25 +02:00
Volker Lendecke
db1bee97f2 ctdbd_conn: Make register_with_ctdbd use an int-returning callback
This will allow an early return from ctdbd_msg_call_back so that we can also
handle CTDB_SRVID_RELEASE_IP via register_with_ctdbd.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-14 06:51:21 +02:00
Volker Lendecke
93c91bddd8 Remove ctdb_conn.[ch]
This was only used in notify_internal.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Jul  8 02:53:33 CEST 2015 on sn-devel-104
2015-07-08 02:53:32 +02:00
Volker Lendecke
a4db3b30c5 messaging: Move parsing of ctdb_req_message to ctdbd_conn.c
This way we can remove the ctdb-specific includes from messages_ctdbd.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-06-05 17:51:13 +02:00
Volker Lendecke
32d4419105 ctdbd_conn: Introduce ctdbd_messaging_send_iov()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
1052d3164c ctdbd_conn: Move ndr marshalling to messages_ctdb.c
The inter-node message format belongs into messages_ctdb, not into the
generic ctdb connection layer

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
d669bd8243 ctdbd_conn: Move ctdbd_register_reconfigure to a callback
Move functionality out of ctdbd_conn to its right place into smbd

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
467fee4d5a ctdbd_conn: Add callback args to register_with_ctdbd
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-05-28 11:13:09 +02:00
Volker Lendecke
db2f5b4c21 lib: Add ctdbd_messaging_send to ctdb_dummy.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-16 18:56:04 +01:00
Stefan Metzmacher
e93b85dbd8 s3:wscript: only build ctdb_dummy.c if we have no cluster support
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-03-24 17:09:11 +01:00
Stefan Metzmacher
24054b5f8b s3:param: move lp_ctdbd_socket() to ctdbd_conn.c
This allows us to use CTDB_PATH only in ctdbd_conn.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-03-24 17:09:10 +01:00
Stefan Metzmacher
b2c9921622 s3:lib: move all ctdb related dummy functions to ctdb_dummy.c
This gets all dummy functions for the build without CLUSTER_SUPPORT.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-03-24 17:09:10 +01:00