Ronnie Sahlberg [Mon, 23 Apr 2007 07:05:09 +0000 (17:05 +1000)]
add a comment that sometimes sending remote calls straight to the
lmaster instead of what the nodes think is the dmaster (which might be
stale) improve performance.
Andrew Tridgell [Sun, 22 Apr 2007 12:26:45 +0000 (14:26 +0200)]
- when handling a record migration in the lmaster, bypass the usual
dmaster request stage, and instead directly send a dmaster
reply. This avoids a race condition where a new call comes in for
the same record while processing the dmaster request
- don't keep any redirect records during a ctdb call. This prevents a
memory leak in case of a redirect storm
Peter Somogyi [Fri, 20 Apr 2007 12:26:19 +0000 (14:26 +0200)]
- ctdb/ib minor bugfixes (error case)
- make ctdb capable of alternative connection (like ib) again, solved the fork problem
- do_debug memory overwrite bugfix (occured using ibwrapper_test with wrong address given)
Andrew Tridgell [Fri, 20 Apr 2007 07:58:37 +0000 (17:58 +1000)]
- fixed a problem with packets to ourselves. The packets were being
processed immediately, but the input routines indirectly assumed
they were being called as a new event (for example, a calling
routine might queue the packet, then afterwards modify the ltdb
record). The solution was to make self packets queue via a zero
timeout.
- fixed unlinking of the socket in a exit in the lockwait code. Needed
an _exit instead of exit so atexit() doesn't trigger
Andrew Tridgell [Thu, 19 Apr 2007 07:43:27 +0000 (17:43 +1000)]
- split out ctdb_ltdb_lock_fetch_requeue() into a simpler
ctdb_ltdb_lock_requeue() and a small wrapper
- use ctdb_ltdb_lock_requeue() to fix a possible hang in
ctdb_reply_dmaster(), where the ctdb_ltdb_store() could hang waiting
for a client. We now requeue the reply_dmaster packet until we have
the lock
Andrew Tridgell [Thu, 19 Apr 2007 06:27:56 +0000 (16:27 +1000)]
- added a --torture option to all ctdb tools. This sets
CTDB_FLAG_TORTURE, which forces some race conditions to be much more
likely. For example a 20% chance of not getting the lock on the
first try in the daemon
- abstraced the ctdb_ltdb_lock_fetch_requeue() code to allow it to
work with both inter-node packets and client->daemon packets
- fixed a bug left over in ctdb_call from when the client updated the
header on a call reply
- removed CTDB_FLAG_CONNECT_WAIT flag (not needed any more)
Ronnie sahlberg [Thu, 19 Apr 2007 02:48:19 +0000 (12:48 +1000)]
the checks for srcnode and destnode from the client are redundant since the daemon will sort these out itself before it sends the call of to either the local handler or a remote daemon
Andrew Tridgell [Thu, 19 Apr 2007 00:37:44 +0000 (10:37 +1000)]
- make he packet allocation routines take a mem_ctx, which allows
us to put memory directly in the right context, avoiding quite a few
talloc_steal calls, and simplifying the code
- make the fetch lock code in the daemon fully async
Ronnie sahlberg [Thu, 19 Apr 2007 00:24:11 +0000 (10:24 +1000)]
ctdbd does no longer take a --daemon parameter since we no longer do non-daemon mode
remove the parameter from the ctdbd script
remove the store_unlock from ctdbd_test since there is no and will be no pdu for this
CTDB_REPLY_FETCH_LOCK no longer return the data for the record since the client is assumed to read this itself from the local tdb. remove some variables that no longer exists.
Andrew Tridgell [Thu, 19 Apr 2007 00:03:20 +0000 (10:03 +1000)]
avoid a deadlock the fetch_lock code. The deadlock could happen when
a client held the chainlock, and the daemon received a dmaster reply
at the same time. The daemon would not be able to process the dmaster
reply, due to the lock, but the fetch lock cannot make progres until
the dmaster reply is processed.
The solution is to not hold the lock in the client while talking to
the daemon. The client has to retry the lock after the record has
migrated. This means that forward progress is not guaranteed. We'll
have to see if that matters in practice.
Andrew Tridgell [Wed, 18 Apr 2007 23:58:23 +0000 (09:58 +1000)]
- use separate directories for the tdb files by default
- use TDB_CLEAR_IF_FIRST to ensure we don't use an old tdb
(This used to be ctdb commit ac47d7b4eb79597da1358da21f10e634cdc9dd2e)
Andrew Tridgell [Wed, 18 Apr 2007 09:12:29 +0000 (19:12 +1000)]
this fixes a timeout error spotted by volker
It ensures that when the client context goes away (such as when the client exits)
that any timed events and partially completed requests from that client also go away
(This used to be ctdb commit 45a45a0a44d4da9b45719aac72b0ae4bd4c74462)
Andrew Tridgell [Wed, 18 Apr 2007 05:35:41 +0000 (15:35 +1000)]
simpler shutdown process. The reply is not actually needed, and
occasionally leads to problems if an immediate send on the socket
causes a context switch and the client exiting before the daemon. We
now exit the client when the daemon goes away.
Ronnie sahlberg [Wed, 18 Apr 2007 04:08:45 +0000 (14:08 +1000)]
add/finish the ctdb_shutdown() function.
this function can be used in test applications to perform an orderly shutdown of the ctdb cluster once the test has completed.
the ctdb nodes will remain operational until all of them have received a shutdown from their client(s) after which the ctdb daemons will all terminate.
this eliminates the need to using sleep() in some of the test applications
Andrew Tridgell [Wed, 18 Apr 2007 01:20:24 +0000 (11:20 +1000)]
- merge volkers debug changes
- fixed memory leaks in the 3 packet receive routines. The problem was
that the ctdb_call logic would occasionally complete and free a
incoming packet, which would then be freed again in the packet
receive routine. The solution is to make the packet a child of a
temporary context in the receive routine then free that temporary
context. That allows other routines to keep or free the packet if
they want to, while allowing us to safely free it (via a free of the
temporary context) in the receive function
Ronnie sahlberg [Wed, 18 Apr 2007 00:38:11 +0000 (10:38 +1000)]
enhance fetch1 test to verify that a lock is released when a client terminates while holding the lock and the next blocked waiting client is assigned the lock