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

61 Commits

Author SHA1 Message Date
Andrew Tridgell
9e8002dd67 fixed the reverse of the last bug - handle the case when the new dmaster is the lmaster
(This used to be ctdb commit b2599834d2ace7369a1b36f85fdf6eb62f047e30)
2007-04-22 18:19:49 +02:00
Andrew Tridgell
107d91e391 - 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

(This used to be ctdb commit 59889ca0fd606c7d2156839383a09dfc5a2e4853)
2007-04-22 14:26:45 +02:00
Andrew Tridgell
520f7971cd - prevent sending dmaster requests to ourselves
- add some debug code

(This used to be ctdb commit 26ad1ec3a3b872520a735e4fe4f224f716643731)
2007-04-21 09:22:46 +02:00
Andrew Tridgell
00c706c2b8 - 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

- print latency of lockwait delays

(This used to be ctdb commit 1b0684b4f6a976f4c5fe54394ac54d121810b298)
2007-04-20 17:58:37 +10:00
Andrew Tridgell
e5c5a91a7b - 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

(This used to be ctdb commit 97cd7aa09ce3abbb5e3e965c5c81668e0c0133a5)
2007-04-19 17:43:27 +10: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
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
d0af75d1fa - fully separate the client version of ctdb_call from the daemon
version. The client version is different enough that this is
  worthwhile

- enable local shortcut for client version of ctdb_call

- add idr_find_type(), with better error reporting in case of type
  mismatch

(This used to be ctdb commit 2388094c5f7b6ce003e86b05620c06217d63b49c)
2007-04-19 11:28:01 +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
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
Volker Lendecke
27837c197a Clean up the call_states correctly
(This used to be ctdb commit 9fcc40a2ddd8f7f62bdd8b5ab71d182220e23af0)
2007-04-17 23:40:33 +02:00
Volker Lendecke
84d276a5be Some more debug and two memleak fixes
(This used to be ctdb commit 1e2802422794956827263265306952df5e69b377)
2007-04-17 23:03:30 +02:00
Volker Lendecke
6c597d3e83 typo
(This used to be ctdb commit bf2799504498ae452bb7244ae3eb6a51797afe9b)
2007-04-17 21:23:22 +02:00
Andrew Tridgell
7758511568 use the common cmdline code in ctdbd
add a basic debug system with -dXX

(This used to be ctdb commit af9f21cef79f888c57d3b50a23ca787c9567ce60)
2007-04-17 22:13:06 +10:00
Andrew Tridgell
0d91f8043e fixed a missing idr remove, and check the types after idr_find()
(This used to be ctdb commit 74028de89d18bfedcea17415d6d6dc2f7c69b076)
2007-04-17 20:03:01 +10:00
Andrew Tridgell
6fce6e419a update destination in a redirect reply
(This used to be ctdb commit b2836974ad270e823c630e3acf12327b53c37d88)
2007-04-17 17:11:12 +10:00
Andrew Tridgell
eba2a4b88c start using ctdb_ltdb_lock_fetch_requeue()
(This used to be ctdb commit f89ab3a06b4677f56c92768c3a8ae5ec9f5abbc2)
2007-04-17 16:54:03 +10:00
Andrew Tridgell
1a1aedf78f when we get a lmaster request, skip updating the header when we are also the new dmaster
(This used to be ctdb commit 6c48dcc5df7b855fc8e0774c9572c7b2af618348)
2007-04-17 16:35:28 +10: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
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
bccf3c7e8e create symbols for fetch lock response status
(This used to be ctdb commit d8243f474897dc65fb7286225b07bdf48b6faed0)
2007-04-17 12:42:52 +10:00
Ronnie sahlberg
11b5345afc finalize fetch lock changes to get rid of the record handle
(This used to be ctdb commit 36c1e98a5533214d5507699dc5d8bdec35cb28c2)
2007-04-17 12:36:31 +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
34bf25e227 - 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)

(This used to be ctdb commit d85955640e670dd580073da96b25fb8a10c08d18)
2007-04-16 10:21:44 +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
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
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
f2d13d0ea9 Fix uninitialized variable warnings
(This used to be ctdb commit b84f97adfd25b2fbfab1c7964b68931643e8029c)
2007-04-11 12:49:10 +02: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
e5fc2d4062 merge from ronnie
(This used to be ctdb commit fb06332c246e9f8b98a6391b4eda183e2f03333f)
2007-04-10 13:06:47 +10:00
Andrew Tridgell
9958ded5eb fix a possible free after use
(This used to be ctdb commit 55bc7ee10b9e9df32792b6b5779f094eb513069e)
2007-04-10 13:05:23 +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
Ronnie sahlberg
b384019536 dispatcher daemon first try.
does not yet work

(This used to be ctdb commit ff428808c6546d6f2804a1ac1cf414d1bb9cdcb4)
2007-04-09 11:51:27 +10:00
Andrew Tridgell
76c666fe52 another memory leak
(This used to be ctdb commit 10466fe11da71c93fa764bea2b3e1e741c113f9c)
2007-04-07 10:58:14 +10:00
Andrew Tridgell
01c4a086e7 fixed a bunch of memory leaks
(This used to be ctdb commit 2ba2522f2def3032c89c7973915610a245842b07)
2007-04-07 10:45:00 +10:00
Andrew Tridgell
eb73358691 added a magic header for wireshark and packet version info
(This used to be ctdb commit 8366c212bde710dd46c8c1d9d4301f6c3738e300)
2007-04-06 14:41:05 +10:00
Andrew Tridgell
230c97b04d merge fetch code from ronnie, and add a simple fetch test
(This used to be ctdb commit 83b794befd8d34b3da544a483f9d39a3fa140655)
2007-04-05 13:18:31 +10:00
Ronnie sahlberg
4d189e2437 first test of forced migration of records. compiles but not tested.
(This used to be ctdb commit ac6ac290e79446f52caf31f429b4c38668c27eda)
2007-04-04 21:15:56 +10:00
Ronnie sahlberg
8ccef4cb75 Split CTDB into sub contexts to handle multiple concurrent databases within the same context.
(This used to be ctdb commit d995103143f6f13f59118549d93ab4b29c27ec89)
2007-04-03 19:41:00 +10:00
Andrew Tridgell
26d62554c2 merged ctdb messaging code from samba4
(This used to be ctdb commit af3010562763811deb9b7e37fea9962a42885d9d)
2007-02-09 09:42:04 +11:00
Andrew Tridgell
c16b530257 merge status code changes from samba4 ctdb
(This used to be ctdb commit 705a9f8e5238976aa5c8cd4a5371459650d8b553)
2007-01-29 22:30:06 +11:00
Andrew Tridgell
d331277659 fix a bug in new structure handling
(This used to be ctdb commit 5f248d82717c8094f260ea16292996bb712df947)
2007-01-29 22:11:16 +11:00
Andrew Tridgell
0dd4a16d26 simplified ctdb_call() interface, and made it easier to expand with more parameters later
(This used to be ctdb commit 6c816fe85e84faad167101bcf26850966c3044e5)
2007-01-25 16:13:17 +11:00
Andrew Tridgell
a8d382ffef use ctdb_call_info, so struct ctdb_call can be used for top level call
(This used to be ctdb commit 05565ce504b75671566661199f5203a9ace31583)
2007-01-25 15:19:16 +11:00
Andrew Tridgell
16d2ca6fa0 merge fixes from samba4
(This used to be ctdb commit fb90a5424348d0b6ed9a1b8da4ceadcc4d1a1cb1)
2007-01-23 11:38:45 +11:00
Andrew Tridgell
3c097c9a5f added handling of partial packet reads
added transport level packet allocator, allowing the transport to
enforce alignment or special memory rules

(This used to be ctdb commit 50304a5c4d8d640732678eeed793857334ca5ec1)
2006-12-19 12:03:10 +11:00
Andrew Tridgell
ee547a0f9a wrap the packet queue call
(This used to be ctdb commit 4dd8ffd5752aedcaf0b8ad1941a5f84ec1ca2868)
2006-12-18 16:26:57 +11:00
Andrew Tridgell
ab7185c2ce added request_dmaster and reply_dmaster logic
ctdb will now move the dmaster role between nodes after
CTDB_MAX_LACOUNT consecutive accesses by the same node.

(This used to be ctdb commit af87f587d8f70192ecac0125054bf9583a4849a7)
2006-12-18 16:01:11 +11:00