Andrew Tridgell [Mon, 16 Apr 2007 12:52:58 +0000 (22:52 +1000)]
merge local copy of tdb from samba4 tdb
Andrew Tridgell [Mon, 16 Apr 2007 12:49:37 +0000 (22:49 +1000)]
fixed a fd bug (thanks volker)
Andrew Tridgell [Mon, 16 Apr 2007 06:01:37 +0000 (16:01 +1000)]
this is a demonstration of an idea for handling locks in ctdb.
The problem we have is this:
- we want the client smbd processes to be able to 'shortcut' access
to the ltdb, by directly accessing the ltdb, and if the header of
the record shows we are the dmaster then process immediately, with
no overhead of talking across the unix domain socket
- a client doing a shortcut will use tdb_chainlock() to lock the
record while processing
- we want the main ctdb daemon to be able to set locks on the
record, and when those locks collide with a 'shortcut' fcntl lock,
we want the ctdb daemon to keep processing other operations
- we don't want to have to send a message from a smbd client to the
ctdbd each time it releases a lock
The solution is shown in this example. Note that the expensive fork()
and blocking lock is only paid in case of contention, so in the median
case I think this is zero cost.
Andrew Tridgell [Mon, 16 Apr 2007 04:13:10 +0000 (14:13 +1000)]
merged from samba4
Andrew Tridgell [Mon, 16 Apr 2007 04:12:50 +0000 (14:12 +1000)]
pull out common command line code for tests into tests/cmdline.c
Andrew Tridgell [Mon, 16 Apr 2007 00:31:39 +0000 (10:31 +1000)]
merge CTDB_SRVID_ALL patch from Samba4
Andrew Tridgell [Mon, 16 Apr 2007 00:21:44 +0000 (10:21 +1000)]
- fix includes to work in both samba4 and ctdb standalone
- when we do a store_unlock the lock record becomes unlocked, so we
must destroy it (or we leak memory)
Andrew Tridgell [Sun, 15 Apr 2007 23:29:10 +0000 (09:29 +1000)]
added --dblist option to ctdbd, to allow list of databases to be specified on the command line
Andrew Tridgell [Sun, 15 Apr 2007 22:58:57 +0000 (08:58 +1000)]
merge from ronnie
Ronnie sahlberg [Sun, 15 Apr 2007 22:37:27 +0000 (08:37 +1000)]
add code to fetch1 test to tell the two child processes one at a time to fetch_lock the same record
they both successfully fetch and lock the same record at this stage but when the actual locking works properly the second child will block.
this test allows us to verify the blocking once we have implemented it
Ronnie sahlberg [Sun, 15 Apr 2007 04:39:23 +0000 (14:39 +1000)]
add examples for volker on how to do fetchlock/storeunlock
note that the actual locking/unl;ocking does not still work
Ronnie sahlberg [Sun, 15 Apr 2007 04:02:39 +0000 (14:02 +1000)]
update to fetch1.sh test
there is still a bug in the ctdb code in that the children no longer receive messages from the parent for unknown reasons
Ronnie sahlberg [Sat, 14 Apr 2007 21:41:35 +0000 (07:41 +1000)]
merge from tridge
Andrew Tridgell [Sat, 14 Apr 2007 10:44:43 +0000 (20:44 +1000)]
merge from ronnie
Ronnie sahlberg [Fri, 13 Apr 2007 11:10:20 +0000 (21:10 +1000)]
merge from tridge
Andrew Tridgell [Fri, 13 Apr 2007 10:38:24 +0000 (20:38 +1000)]
private -> private_data for samba3
Ronnie sahlberg [Fri, 13 Apr 2007 10:37:41 +0000 (20:37 +1000)]
add missing code to store_unlock so that the data that a client writes is stored in ltdb
this makes it possible to do fetch_lock and store_unlock across a domain socket to read/write data.
note that the actual locking is NOT implemented yet
Andrew Tridgell [Fri, 13 Apr 2007 05:49:33 +0000 (15:49 +1000)]
merge store_unlock code from ronnie
Ronnie sahlberg [Thu, 12 Apr 2007 23:44:56 +0000 (09:44 +1000)]
add more elaborate test to fetch1 test
for now:
fetch a record
store a known entry for this record
fetch the record again (and later verify we got the same record)
store it back again
this will not work right now since we dont yet store the record inside the daemon
Ronnie sahlberg [Thu, 12 Apr 2007 23:41:15 +0000 (09:41 +1000)]
add store_unlock pdu's for the domain socket.
note that the store_unlock does not actually do anything yet apart from passing the pdu from client to daemon and daemon responds.
next is to make sure the daemon actually stores the data in a database
Ronnie sahlberg [Thu, 12 Apr 2007 11:35:16 +0000 (21:35 +1000)]
merge from tridge
Andrew Tridgell [Thu, 12 Apr 2007 11:32:16 +0000 (21:32 +1000)]
merge from ronnie
Ronnie sahlberg [Thu, 12 Apr 2007 11:19:00 +0000 (21:19 +1000)]
add the two missing file from the previous commit
Ronnie sahlberg [Thu, 12 Apr 2007 11:17:10 +0000 (21:17 +1000)]
add a beginning of a new test
right now this test only does one fetch lock but this will be enhanced as more code is added to ctdb to handle fetch_lock and store_unlock
Ronnie sahlberg [Thu, 12 Apr 2007 11:14:41 +0000 (21:14 +1000)]
when sending back a fetch lock reply to a client
we cant peek in state->c since this is uninitialized
and even if it were not it would be wrong
create a new structure to pass BOTH client and also the reqid to respond back to
the client with
Ronnie sahlberg [Thu, 12 Apr 2007 07:13:48 +0000 (17:13 +1000)]
merge from tridges tree
Andrew Tridgell [Thu, 12 Apr 2007 06:51:33 +0000 (16:51 +1000)]
merge from ronnie
Ronnie sahlberg [Thu, 12 Apr 2007 06:49:37 +0000 (16:49 +1000)]
dont hardcode gdb in the test script. ooops
Ronnie sahlberg [Thu, 12 Apr 2007 05:46:50 +0000 (15:46 +1000)]
initial support for two new pdus for the domain socket to do fetch_lock
no locking is yet done and the store_unlock call is still missing
the ./tests/fetch.sh --daemon test fails with parent process dying which needs to be investigated.
Ronnie sahlberg [Thu, 12 Apr 2007 00:52:19 +0000 (10:52 +1000)]
merge from volker
Andrew Tridgell [Thu, 12 Apr 2007 00:51:55 +0000 (10:51 +1000)]
merge from vl
Andrew Tridgell [Thu, 12 Apr 2007 00:44:18 +0000 (10:44 +1000)]
merge from ronnie
Ronnie sahlberg [Wed, 11 Apr 2007 23:09:27 +0000 (09:09 +1000)]
add an example on how to read a message from the domain socket
Ronnie sahlberg [Wed, 11 Apr 2007 22:44:15 +0000 (08:44 +1000)]
do an infinite loop calling event_loop_once() in the ctdbd parent process instead of event_loop_wait() since the latter will return and thus take down the daemon
Ronnie sahlberg [Wed, 11 Apr 2007 22:28:54 +0000 (08:28 +1000)]
add a test message to the messaging test so we can see that the message data is also passed from originator to receiver
Ronnie sahlberg [Wed, 11 Apr 2007 21:49:28 +0000 (07:49 +1000)]
merge from ridge and vl
Volker Lendecke [Wed, 11 Apr 2007 18:12:15 +0000 (20:12 +0200)]
Rename "private" to "private_data"
Volker Lendecke [Wed, 11 Apr 2007 14:52:06 +0000 (16:52 +0200)]
Merge tridge's tree
Volker Lendecke [Wed, 11 Apr 2007 14:51:25 +0000 (16:51 +0200)]
Add a test to read back the message
Volker
Andrew Tridgell [Wed, 11 Apr 2007 12:21:43 +0000 (22:21 +1000)]
use event_loop_wait instead of while(1)
Andrew Tridgell [Wed, 11 Apr 2007 12:19:46 +0000 (22:19 +1000)]
use lib/replace for signal.h
Andrew Tridgell [Wed, 11 Apr 2007 12:17:24 +0000 (22:17 +1000)]
merge from volker
Andrew Tridgell [Wed, 11 Apr 2007 12:11:07 +0000 (22:11 +1000)]
merge from ronnie
Volker Lendecke [Wed, 11 Apr 2007 11:57:58 +0000 (13:57 +0200)]
merge
Volker Lendecke [Wed, 11 Apr 2007 11:17:36 +0000 (13:17 +0200)]
Handle a client that exited correctly: We need to ignore SIGPIPE and when the
read returns 0 bytes this means the client has exited. Close the connection
then.
Volker Lendecke [Wed, 11 Apr 2007 10:49:10 +0000 (12:49 +0200)]
Fix uninitialized variable warnings
Ronnie sahlberg [Wed, 11 Apr 2007 10:32:24 +0000 (20:32 +1000)]
add an example on how to send a message to the daemon
(send a message to ourself)
this unfortunately terminates the ctdb daemon when running but im too tired right now to debug it.
checkin so that nothing gets lost overnight.
Ronnie sahlberg [Wed, 11 Apr 2007 09:27:19 +0000 (19:27 +1000)]
add call/reply parsing of the cluster connect-wait call to the test daemon.
Ronnie sahlberg [Wed, 11 Apr 2007 09:04:09 +0000 (19:04 +1000)]
add a vnn field to the ctdb_reply_connect_wait pdu so that we can tell
non-ctdb-linked clients what the vnn of the local cluster daemon is
Ronnie sahlberg [Wed, 11 Apr 2007 08:54:22 +0000 (18:54 +1000)]
create a standalone ctdb daemon and a script ./direct/ctdbd.sh to start two such daemons in a 2 node cluster.
create a small test application that connects to the ctdb daemon at /tmp/ctdb.socket.127.0.0.1 and do some commands to the daemon.
currently this test tool only opens the socket and registers its pid with the daemon
(the daemon needs to know the pid so that it can forward messages to the correct client)
the test will be extended with additional ctdb commands
Ronnie sahlberg [Wed, 11 Apr 2007 05:40:03 +0000 (15:40 +1000)]
merge from tridge
Andrew Tridgell [Wed, 11 Apr 2007 05:23:50 +0000 (15:23 +1000)]
added --num-clients option to ctdb_messaging test
Andrew Tridgell [Wed, 11 Apr 2007 05:09:22 +0000 (15:09 +1000)]
use the new connect_wait code in the ctdb_messaging test
Andrew Tridgell [Wed, 11 Apr 2007 04:54:47 +0000 (14:54 +1000)]
add proper support for ctdb_connect_wait in daemon mode
Andrew Tridgell [Wed, 11 Apr 2007 04:26:14 +0000 (14:26 +1000)]
fixed sending messages to ourselves in non-daemon mode
Andrew Tridgell [Wed, 11 Apr 2007 04:05:01 +0000 (14:05 +1000)]
merge from ronnie, plus complete the client side of inter-node messaging
Ronnie sahlberg [Wed, 11 Apr 2007 03:43:15 +0000 (13:43 +1000)]
add a test that sends messages between clients connected to the same ctdb
add code to actually pass the messages between clients and ctdb
Andrew Tridgell [Wed, 11 Apr 2007 01:58:28 +0000 (11:58 +1000)]
partially completed work towards full messaging system which will work in both daemon and standalone mode. Does not compile\! committing so ronnie can continue while I'm out
Andrew Tridgell [Wed, 11 Apr 2007 01:11:44 +0000 (11:11 +1000)]
merge from ronnie
Ronnie sahlberg [Wed, 11 Apr 2007 01:08:20 +0000 (11:08 +1000)]
merge from tridge
Andrew Tridgell [Wed, 11 Apr 2007 01:02:26 +0000 (11:02 +1000)]
forgot to add ctdb_client.c
Andrew Tridgell [Wed, 11 Apr 2007 01:01:42 +0000 (11:01 +1000)]
- add --daemon flag to ctdb_fetch test code
- split client specific routines out of ctdb_daemon.c
- use ctdb_queue code in message send from client to daemon
- use clearer names in client/daemon functions
- use talloc autofree context to avoid global for unlink of socket on
exit
- start on API change for message handler, to allow ctdb messaging to
handle daemon mode with multiple clients
Ronnie sahlberg [Tue, 10 Apr 2007 11:14:55 +0000 (21:14 +1000)]
rename client.id to client.messenger_id to make the purpose of the field more obvious
Ronnie sahlberg [Tue, 10 Apr 2007 11:05:29 +0000 (21:05 +1000)]
add a call to register the pid for a messengin service
store this pid inside the client structure in the ctdb daemon
Andrew Tridgell [Tue, 10 Apr 2007 10:48:31 +0000 (20:48 +1000)]
fix the queueing for partially connected tcp sockets
Ronnie sahlberg [Tue, 10 Apr 2007 10:25:11 +0000 (20:25 +1000)]
updates from tridges tree
Andrew Tridgell [Tue, 10 Apr 2007 09:40:29 +0000 (19:40 +1000)]
make some functions static, and remove an unused structure
Andrew Tridgell [Tue, 10 Apr 2007 09:35:21 +0000 (19:35 +1000)]
merge from ronnie
Andrew Tridgell [Tue, 10 Apr 2007 09:33:21 +0000 (19:33 +1000)]
made all sockets handle partial IO
abstract IO via ctdb_queue_*() functions
Ronnie sahlberg [Tue, 10 Apr 2007 04:53:23 +0000 (14:53 +1000)]
remove old ifdef that remained from when this was a header file
Andrew Tridgell [Tue, 10 Apr 2007 04:48:13 +0000 (14:48 +1000)]
merge tcp changes from ronnie
Andrew Tridgell [Tue, 10 Apr 2007 04:46:32 +0000 (14:46 +1000)]
added daemon mode to ctdb_bench
Ronnie sahlberg [Tue, 10 Apr 2007 03:17:15 +0000 (13:17 +1000)]
change the tcp code to call ctdb_read_pdu() instead of doing the partial read thing explicitely
Andrew Tridgell [Tue, 10 Apr 2007 03:06:47 +0000 (13:06 +1000)]
merge from ronnie
Andrew Tridgell [Tue, 10 Apr 2007 03:05:23 +0000 (13:05 +1000)]
fix a possible free after use
Andrew Tridgell [Tue, 10 Apr 2007 02:51:54 +0000 (12:51 +1000)]
fix configure for new test location
Ronnie sahlberg [Tue, 10 Apr 2007 02:39:25 +0000 (12:39 +1000)]
move the checking of the CONNECT_WAIT flag into the start method for tcp
Ronnie sahlberg [Tue, 10 Apr 2007 02:23:10 +0000 (12:23 +1000)]
restore the test script that was updated by mistake in the previous checkin
Ronnie sahlberg [Tue, 10 Apr 2007 02:18:58 +0000 (12:18 +1000)]
add a CONNECT_WAIT flag to replace the call ctdb_connect_wait() since
we can no longer use this function from the application if we are in daemon mode.
add a horrible "sleep()" to ctdb_test.c to prevent the daemon from dissapearing (parent process died) when the application exits which may happen before the other nodes in the test have finished talking to our daemon
Ronnie sahlberg [Mon, 9 Apr 2007 22:47:39 +0000 (08:47 +1000)]
add a atexit() call to remove the domain socket when the daemon exits
Ronnie sahlberg [Mon, 9 Apr 2007 22:38:29 +0000 (08:38 +1000)]
change ctdb_client_read() to use the ctdb_read_pdu() helper
Ronnie sahlberg [Mon, 9 Apr 2007 20:03:39 +0000 (06:03 +1000)]
make normal/deamon mode controllable by a ctdb flag so that the api looks the same in both modes to a client.
send the correct structure back to a client
assorted other cleanups
(tests/test1.sh now works in daemon mode)
Ronnie sahlberg [Mon, 9 Apr 2007 01:51:27 +0000 (11:51 +1000)]
dispatcher daemon first try.
does not yet work
Ronnie sahlberg [Sun, 8 Apr 2007 02:11:48 +0000 (12:11 +1000)]
merge from tridge
Andrew Tridgell [Sat, 7 Apr 2007 00:58:14 +0000 (10:58 +1000)]
another memory leak
Andrew Tridgell [Sat, 7 Apr 2007 00:46:47 +0000 (10:46 +1000)]
remove talloc debug code
Andrew Tridgell [Sat, 7 Apr 2007 00:45:00 +0000 (10:45 +1000)]
fixed a bunch of memory leaks
Andrew Tridgell [Sat, 7 Apr 2007 00:01:09 +0000 (10:01 +1000)]
put test code in tests/ directory
Andrew Tridgell [Fri, 6 Apr 2007 04:41:05 +0000 (14:41 +1000)]
added a magic header for wireshark and packet version info
Andrew Tridgell [Thu, 5 Apr 2007 23:46:45 +0000 (09:46 +1000)]
merge from ronnie
Ronnie sahlberg [Thu, 5 Apr 2007 23:08:41 +0000 (09:08 +1000)]
When we create a tcp connection to a remote ctdb node do an explicit bind() to set our source side to the same ip address as we use to listen to ctdb traffic.
We need this since there is no guarantee that INADDR_ANY (which would be defaulted to if we dont bind) would be routable from the remote host.
This is entirely possible to happen since CTDB traffic is likely to be isolated to a private non-routable network.
Andrew Tridgell [Thu, 5 Apr 2007 03:19:06 +0000 (13:19 +1000)]
merge from ronnies branch
Andrew Tridgell [Thu, 5 Apr 2007 03:18:31 +0000 (13:18 +1000)]
merge fetch code from ronnie, and add a simple fetch test
Ronnie sahlberg [Wed, 4 Apr 2007 11:15:56 +0000 (21:15 +1000)]
first test of forced migration of records. compiles but not tested.
Ronnie sahlberg [Wed, 4 Apr 2007 05:05:35 +0000 (15:05 +1000)]
tridge
Andrew Tridgell [Wed, 4 Apr 2007 05:02:49 +0000 (15:02 +1000)]
merge back some changes from Samba4
Andrew Tridgell [Tue, 3 Apr 2007 10:13:50 +0000 (20:13 +1000)]
merge multi-database support from ronnie
Ronnie sahlberg [Tue, 3 Apr 2007 09:41:00 +0000 (19:41 +1000)]
Split CTDB into sub contexts to handle multiple concurrent databases within the same context.
Andrew Tridgell [Thu, 8 Mar 2007 00:27:15 +0000 (11:27 +1100)]
merged changes from peter
Peter Somogyi [Mon, 26 Feb 2007 10:59:20 +0000 (11:59 +0100)]
ib: added external send queue to workaround downtime
Workaround is because I couldn't find a correct way in ib to reconnect cleanly (with queue kept) when destination is unreachable.
When connection is broken, all internal queue contents are being destroyed and reconnects automatically.
An "external" send queue is kept until the connection is up again for a dest node.