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

50 Commits

Author SHA1 Message Date
Andrew Tridgell
e9d43f5e43 - expanded status to include count of each call type
- added lockwait latency

(This used to be ctdb commit 0b5d196147e644cf8b172cb4b593fd46b1caa386)
2007-04-20 21:02:53 +10:00
Andrew Tridgell
2e5aae04de added ctdb_status tool
(This used to be ctdb commit 908d6c6a936e21f70f05827ce302e966cca0132a)
2007-04-20 20:07:47 +10:00
Andrew Tridgell
bba02ce182 merged fix from volker (thanks!)
(This used to be ctdb commit 5f51864f837de5fd262d6a41722605789494cb66)
2007-04-20 07:50:34 +10:00
Andrew Tridgell
01b7eac536 minor debug changes
(This used to be ctdb commit 1950d96458238782c3bfd8e41a053c4be8330ef9)
2007-04-20 07:47:37 +10:00
Volker Lendecke
5edb0a8011 The remote node needs to get the IMMEDIATE_MIGRATION flag to actually send the
record


(This used to be ctdb commit 9159434b1eef39b7de58b30626039f1e45a97306)
2007-04-19 17:44:45 +02:00
Andrew Tridgell
273a3944a8 - 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)

(This used to be ctdb commit 7559dcd184666c3853127e3c8f5baef4fea327c4)
2007-04-19 16:27:56 +10:00
Ronnie sahlberg
db12f3359b 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
(This used to be ctdb commit 9175d49ba1ce2af99907fa227b50d281f85c98ae)
2007-04-19 12:48:19 +10:00
Ronnie sahlberg
63e513aeeb add some tests in the daemon that a REQ_CALL that a client sent us has valid srcnode and destnode
update ctdbd_test.c to show how to force a migration onto the local node

(This used to be ctdb commit fe313cee4927075be311e28ea106bd5cc035f217)
2007-04-19 12:33:13 +10:00
Andrew Tridgell
e830dfd18d much simpler fetch code!
fetch is now confined to the client code, no spcial code at
all in the daemon. 

(This used to be ctdb commit 3ec801c9717e250b902760862df188e03c9bdbf4)
2007-04-19 11:56:37 +10:00
Andrew Tridgell
b79e29c779 - 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

(This used to be ctdb commit d98b4b4fcadad614861c0d44a3854d97b01d0f74)
2007-04-19 10:37:44 +10:00
Andrew Tridgell
fde5a66531 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.

(This used to be ctdb commit 737e5a1253cb048222c595a474aff71c99fc554f)
2007-04-19 10:03:20 +10:00
Andrew Tridgell
31e2331608 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)
2007-04-18 19:12:29 +10:00
Andrew Tridgell
908f5085b0 validate dmaster on a client fetch request
(This used to be ctdb commit b49069aac0c14e5a02be843247930c197d620a81)
2007-04-18 18:39:02 +10:00
Andrew Tridgell
ddf430b2f2 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.

(This used to be ctdb commit b7bed0088e700f25105ceea63640b38804f51e4d)
2007-04-18 15:35:41 +10:00
Ronnie sahlberg
adb4becfb7 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

(This used to be ctdb commit f35db69dc190b11659aad85495bb66308fdb5599)
2007-04-18 14:08:45 +10:00
Ronnie sahlberg
e390c925c1 initial shutdown function where a client can request an orderly shutdown of a ctdb cluster
(This used to be ctdb commit 00d2748bd4e7209ff7e253f6652fdd9bf16cf147)
2007-04-18 12:39:03 +10:00
Andrew Tridgell
7a02b09b01 started adding a cleaner daemon finish method
(This used to be ctdb commit 5ef0cd83d7f24616dad85cece485b770376ecd45)
2007-04-18 11:55:54 +10:00
Andrew Tridgell
aac20642b2 bit less verbose when client exits
(This used to be ctdb commit a6477577beba71bd9185b968de43b763378f234b)
2007-04-18 11:33:16 +10:00
Andrew Tridgell
8f059f4d91 - 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

(This used to be ctdb commit 304aaaa7235febbe97ff9ecb43875b7265ac48cd)
2007-04-18 11:20:24 +10:00
Andrew Tridgell
8a7b573320 more DEBUG() calls
(This used to be ctdb commit 79f3d63eec5652d87f13875c76e90ead81a26ad9)
2007-04-17 22:27:17 +10:00
Volker Lendecke
748cc9e4b7 ZERO_STRUCT writes one byte too many here.
(This used to be ctdb commit 3c5c433e5b92f8fe2193a6e5720e31e3eb6bc76b)
2007-04-17 09:36:53 +02:00
Andrew Tridgell
296b0c2a20 - send the record header from the client to the daemon when doing a
fetch, to avoid the daemon re-reading it

- suffix the database name with the node name so that testing on
  loopback doesn't result in a name collision in the database open

(This used to be ctdb commit ad30a4db75450643ff146c40faa306a021de3dd2)
2007-04-17 16:20:32 +10:00
Andrew Tridgell
b87de399f2 block SIGPIPE in the daemon to prevent a SIGPIPE on write to a dead socket
(This used to be ctdb commit 02c09dc07c9bed57ca3692b14e41ac8cca0a29f4)
2007-04-17 15:33:20 +10:00
Andrew Tridgell
6f9b29da22 - removed the non-daemon mode from ctdb, in order to simplify the
code. It may be added back later once everything is working nicely,
  or simulated using a in-process pipe instead of a unix domain socket

- rewrote the ctdb_fetch_lock() code to follow the new design

(This used to be ctdb commit 5024dd1f305fe1ecc262db2240c56f773b4f28f0)
2007-04-17 14:52:51 +10:00
Ronnie sahlberg
45660a3c48 remaning code to finish lock_fetch/store_unlock clientside helpers
(This used to be ctdb commit edf1e1fea8500461a08cd2795251a5cc0bd10229)
2007-04-17 11:48:27 +10:00
Ronnie sahlberg
481e029768 initial change to remove store_unlock pdu and use tdb chainlock in the client
(This used to be ctdb commit 87dd265d2c61125ca2fa922cfcf9371a234fff0c)
2007-04-17 11:34:45 +10:00
Andrew Tridgell
80ec427ec7 merge from ronnie
(This used to be ctdb commit fcf3669c27691ddb383d1c585234622efa498d90)
2007-04-17 11:30:19 +10:00
Andrew Tridgell
3c2ebff3cb partial merge from volker (some overlaps removed)
(This used to be ctdb commit c4747460a8e0017acfd2a97a632ecd9395562d4f)
2007-04-17 11:26:59 +10:00
Ronnie sahlberg
ee9712620f change some error printouts to make it easier to determine whether the error occured in the client or in the daemon
(This used to be ctdb commit a7e42c2c56e38b4b58ede0ad45767695d704dac4)
2007-04-17 10:15:44 +10:00
Andrew Tridgell
303c464c49 merge from ronnie
(This used to be ctdb commit 867468a7aadc11d0cb4d9f0eab55d3f34f11d6d3)
2007-04-14 20:44:43 +10:00
Ronnie sahlberg
9f7d98380b merge from tridge
(This used to be ctdb commit 9c4e5569b82d9c7894e3ac1d5f0783c4d770daf4)
2007-04-13 21:10:20 +10:00
Andrew Tridgell
65cdf2297a private -> private_data for samba3
(This used to be ctdb commit 080b6901173afb2ad618dd0621876ff478c7d6e5)
2007-04-13 20:38:24 +10:00
Ronnie sahlberg
332f5ad063 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

(This used to be ctdb commit c7a397c56caf71283c081e5b97620085ed5108c6)
2007-04-13 20:37:41 +10:00
Ronnie sahlberg
03c49c0526 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

(This used to be ctdb commit 167d6993e78f6a1d0f6607ef66925a14993ae6a1)
2007-04-13 09:41:15 +10:00
Ronnie sahlberg
3aeac33da2 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

(This used to be ctdb commit e1a0da3dfbb4a927e8d98723b5e51a201c2a3428)
2007-04-12 21:14:41 +10:00
Ronnie sahlberg
35ffefb01f 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.

(This used to be ctdb commit 7d7141c968950a8856f1be79871932b688bfb07f)
2007-04-12 15:46:50 +10:00
Volker Lendecke
6f2b236909 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.

(This used to be ctdb commit bd10f4e62146493848258df8a3dc3b9222337a12)
2007-04-11 13:17:36 +02:00
Ronnie sahlberg
153bf81026 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

(This used to be ctdb commit 57fd1aa54b234545e1e465b5ace2ce93fcfbc22a)
2007-04-11 19:04:09 +10:00
Andrew Tridgell
8386b0e345 add proper support for ctdb_connect_wait in daemon mode
(This used to be ctdb commit 8d110df5939b3e6a6341909956453887f4eb6b0d)
2007-04-11 14:54:47 +10:00
Andrew Tridgell
c658d5c1e8 merge from ronnie, plus complete the client side of inter-node messaging
(This used to be ctdb commit e605417436855d22343462acae4cbb79a374977e)
2007-04-11 14:05:01 +10:00
Ronnie sahlberg
185cd326da add a test that sends messages between clients connected to the same ctdb
add code to actually pass the messages between clients and ctdb

(This used to be ctdb commit 6d5b55d7b9c611fb5e98765906757a7d82e4bf6b)
2007-04-11 13:43:15 +10:00
Andrew Tridgell
ad1f17ab1c 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
(This used to be ctdb commit 1b5e65a700e2bd0a5c913d7866024b25600a14c9)
2007-04-11 11:58:28 +10:00
Andrew Tridgell
110fe0c5a5 - 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

(This used to be ctdb commit 53555db45f3583ae4a32cc3aa9e07fb8ef2a77e3)
2007-04-11 11:01:42 +10:00
Andrew Tridgell
5861917468 make some functions static, and remove an unused structure
(This used to be ctdb commit 8d09cac96b2c604a68e4903346cc9db3a66d80da)
2007-04-10 19:40:29 +10:00
Andrew Tridgell
f1e0174e83 made all sockets handle partial IO
abstract IO via ctdb_queue_*() functions

(This used to be ctdb commit 636ae76f4632b29231db87be32c9114f58b37840)
2007-04-10 19:33:21 +10:00
Ronnie sahlberg
91c39b4852 move the checking of the CONNECT_WAIT flag into the start method for tcp
(This used to be ctdb commit 44f3e4456d931af642192e034f84c961ab1fdcf0)
2007-04-10 12:39:25 +10:00
Ronnie sahlberg
b84ade51db 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

(This used to be ctdb commit 74d35dafe06d71e755f3a58cc58d4b9b56fc821b)
2007-04-10 12:18:58 +10:00
Ronnie sahlberg
31ffe0af35 add a atexit() call to remove the domain socket when the daemon exits
(This used to be ctdb commit 2f685c68e0b17ed8a290a265ebd64c1d089ceec5)
2007-04-10 08:47:39 +10:00
Ronnie sahlberg
c7e54e1437 change ctdb_client_read() to use the ctdb_read_pdu() helper
(This used to be ctdb commit d476aa8533b394af6aced9c80fffaf0eefae1dd0)
2007-04-10 08:38:29 +10:00
Ronnie sahlberg
190b97f0ed 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)

(This used to be ctdb commit f4593754cab750dfdb9384884502e2e1b8fde1f0)
2007-04-10 06:03:39 +10:00