vlendec/samba-autobuild/.git
17 years agomerge from tridge
Ronnie sahlberg [Thu, 19 Apr 2007 01:58:34 +0000 (11:58 +1000)]
merge from tridge

(This used to be ctdb commit e9561cfe190af8c0594de7531fbf087730aae60c)

17 years ago- fully separate the client version of ctdb_call from the daemon
Andrew Tridgell [Thu, 19 Apr 2007 01:28:01 +0000 (11:28 +1000)]
- 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)

17 years ago- make he packet allocation routines take a mem_ctx, which allows
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

(This used to be ctdb commit d98b4b4fcadad614861c0d44a3854d97b01d0f74)

17 years agoctdbd does no longer take a --daemon parameter since we no longer do non-daemon mode
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.

(This used to be ctdb commit 77c43479e1932b27387fc2f85a3cb6538633b481)

17 years agomerge from tridge
Ronnie sahlberg [Thu, 19 Apr 2007 00:07:07 +0000 (10:07 +1000)]
merge from tridge

(This used to be ctdb commit 414952b2dd48de4a9edb532ba9c2cb6e22bb6d7f)

17 years agoavoid a deadlock the fetch_lock code. The deadlock could happen when
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.

(This used to be ctdb commit 737e5a1253cb048222c595a474aff71c99fc554f)

17 years ago- use separate directories for the tdb files by default
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)

17 years agomerged the db_dir changes from volker. Changed them slightly,
Andrew Tridgell [Wed, 18 Apr 2007 23:14:25 +0000 (09:14 +1000)]
merged the db_dir changes from volker. Changed them slightly,
to make the --dbdir option available to all ctdb tools, not just
the daemon

(This used to be ctdb commit add63b0ae11d8727163bb6f0c94a617d9b88ef28)

17 years agomerge from tridge
Ronnie sahlberg [Wed, 18 Apr 2007 22:18:38 +0000 (08:18 +1000)]
merge from tridge

(This used to be ctdb commit a8d7f1af3751276599086735660fec0659d57b1c)

17 years agoAdd --dbdir to ctdbd. Necessary for shared operation between ctdbd and smbd.
Volker Lendecke [Wed, 18 Apr 2007 14:36:22 +0000 (16:36 +0200)]
Add --dbdir to ctdbd. Necessary for shared operation between ctdbd and smbd.
(This used to be ctdb commit bce40105e2ccbca5e364793bbf1a6357e6dd69b2)

17 years agothis fixes a timeout error spotted by volker
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)

17 years agomerged cleanup from ronnie
Andrew Tridgell [Wed, 18 Apr 2007 08:43:34 +0000 (18:43 +1000)]
merged cleanup from ronnie
(This used to be ctdb commit 26037a7b3557faa1c10944f654b1465877c6b840)

17 years agovalidate dmaster on a client fetch request
Andrew Tridgell [Wed, 18 Apr 2007 08:39:02 +0000 (18:39 +1000)]
validate dmaster on a client fetch request
(This used to be ctdb commit b49069aac0c14e5a02be843247930c197d620a81)

17 years agowe dont need the structure ctdb_reply_shutdown since we dont implement that pdu any...
Ronnie sahlberg [Wed, 18 Apr 2007 07:04:26 +0000 (17:04 +1000)]
we dont need the structure ctdb_reply_shutdown since we dont implement that pdu any more

(This used to be ctdb commit 5bac32b3daf3c61214269cd09cfc1b6c3f8c3d6e)

17 years agomerge from tridge
Ronnie sahlberg [Wed, 18 Apr 2007 07:03:10 +0000 (17:03 +1000)]
merge from tridge

(This used to be ctdb commit c8598a3a727049517ee7a923b0ae30b039b9080b)

17 years agosimpler shutdown process. The reply is not actually needed, and
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.

(This used to be ctdb commit b7bed0088e700f25105ceea63640b38804f51e4d)

17 years agouse shutdown in more tests
Andrew Tridgell [Wed, 18 Apr 2007 05:27:38 +0000 (15:27 +1000)]
use shutdown in more tests
(This used to be ctdb commit 150153947b959f90991fdae8d7c85ef8d551dff5)

17 years agomake sure we don't double free in the async lock handler
Andrew Tridgell [Wed, 18 Apr 2007 05:27:26 +0000 (15:27 +1000)]
make sure we don't double free in the async lock handler
(This used to be ctdb commit 67d3e64f82fd71ff1e32bf377d0cf1f636b9602f)

17 years agomerge from tridge
Ronnie sahlberg [Wed, 18 Apr 2007 04:45:08 +0000 (14:45 +1000)]
merge from tridge

(This used to be ctdb commit 4a6cb8a5c411457459eaadddd03ef64924505cd8)

17 years ago- merge from ronnie, and use wait instead of sleep in test scripts
Andrew Tridgell [Wed, 18 Apr 2007 04:42:02 +0000 (14:42 +1000)]
- merge from ronnie, and use wait instead of sleep in test scripts
(This used to be ctdb commit 6e6812641e3ce7afae7bd46ed317a885839fdd4f)

17 years agoadd/finish the ctdb_shutdown() function.
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

(This used to be ctdb commit f35db69dc190b11659aad85495bb66308fdb5599)

17 years agomerge fetch1 changes from ronnie
Andrew Tridgell [Wed, 18 Apr 2007 02:39:12 +0000 (12:39 +1000)]
merge fetch1 changes from ronnie
(This used to be ctdb commit 906419acf121ea93661f91bde65cdcd890f70e63)

17 years agoinitial shutdown function where a client can request an orderly shutdown of a ctdb...
Ronnie sahlberg [Wed, 18 Apr 2007 02:39:03 +0000 (12:39 +1000)]
initial shutdown function where a client can request an orderly shutdown of a ctdb cluster

(This used to be ctdb commit 00d2748bd4e7209ff7e253f6652fdd9bf16cf147)

17 years agostarted adding a cleaner daemon finish method
Andrew Tridgell [Wed, 18 Apr 2007 01:55:54 +0000 (11:55 +1000)]
started adding a cleaner daemon finish method
(This used to be ctdb commit 5ef0cd83d7f24616dad85cece485b770376ecd45)

17 years agomerge from tridge
Ronnie sahlberg [Wed, 18 Apr 2007 01:33:19 +0000 (11:33 +1000)]
merge from tridge

(This used to be ctdb commit e83db4d76ea498413ba4314e937d0ff298bd4cb6)

17 years agobit less verbose when client exits
Andrew Tridgell [Wed, 18 Apr 2007 01:33:16 +0000 (11:33 +1000)]
bit less verbose when client exits
(This used to be ctdb commit a6477577beba71bd9185b968de43b763378f234b)

17 years ago- merge volkers debug changes
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

(This used to be ctdb commit 304aaaa7235febbe97ff9ecb43875b7265ac48cd)

17 years agoenhance fetch1 test to verify that a lock is released when a client terminates while...
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

(This used to be ctdb commit 927228299280779664683fca04a7f76b55bef813)

17 years agomerge from tridge
Ronnie sahlberg [Tue, 17 Apr 2007 23:28:40 +0000 (09:28 +1000)]
merge from tridge

(This used to be ctdb commit d1262efebfc6e51e676720d42443017563aaffe3)

17 years agoClean up the call_states correctly
Volker Lendecke [Tue, 17 Apr 2007 21:40:33 +0000 (23:40 +0200)]
Clean up the call_states correctly

(This used to be ctdb commit 9fcc40a2ddd8f7f62bdd8b5ab71d182220e23af0)

17 years agoBe less verbose
Volker Lendecke [Tue, 17 Apr 2007 21:06:10 +0000 (23:06 +0200)]
Be less verbose

(This used to be ctdb commit 7497b5a9031c471c25bf6029c436fd82788b415c)

17 years agoSome more debug and two memleak fixes
Volker Lendecke [Tue, 17 Apr 2007 21:03:30 +0000 (23:03 +0200)]
Some more debug and two memleak fixes

(This used to be ctdb commit 1e2802422794956827263265306952df5e69b377)

17 years agotypo
Volker Lendecke [Tue, 17 Apr 2007 19:23:22 +0000 (21:23 +0200)]
typo
(This used to be ctdb commit bf2799504498ae452bb7244ae3eb6a51797afe9b)

17 years agoAdd timestamps to debug output.
Volker Lendecke [Tue, 17 Apr 2007 15:59:39 +0000 (17:59 +0200)]
Add timestamps to debug output.
(This used to be ctdb commit 197a02384bd2ca42dfff4c0357175424d2321e9c)

17 years agoadd debug tracing to fetch_lock
Andrew Tridgell [Tue, 17 Apr 2007 12:39:23 +0000 (22:39 +1000)]
add debug tracing to fetch_lock
(This used to be ctdb commit b58d2ae0e4ef3393a93724526f2aebc7529de14f)

17 years agomore DEBUG() calls
Andrew Tridgell [Tue, 17 Apr 2007 12:27:17 +0000 (22:27 +1000)]
more DEBUG() calls
(This used to be ctdb commit 79f3d63eec5652d87f13875c76e90ead81a26ad9)

17 years agomoved cmdline.c to common code
Andrew Tridgell [Tue, 17 Apr 2007 12:16:50 +0000 (22:16 +1000)]
moved cmdline.c to common code
(This used to be ctdb commit 32b31a6b91a19fc0c5225cb88c35cc1d14b4a6df)

17 years agouse the common cmdline code in ctdbd
Andrew Tridgell [Tue, 17 Apr 2007 12:13:06 +0000 (22:13 +1000)]
use the common cmdline code in ctdbd
add a basic debug system with -dXX

(This used to be ctdb commit af9f21cef79f888c57d3b50a23ca787c9567ce60)

17 years agofixed a missing idr remove, and check the types after idr_find()
Andrew Tridgell [Tue, 17 Apr 2007 10:03:01 +0000 (20:03 +1000)]
fixed a missing idr remove, and check the types after idr_find()
(This used to be ctdb commit 74028de89d18bfedcea17415d6d6dc2f7c69b076)

17 years agomake sure we notify ctdb when a node dies
Andrew Tridgell [Tue, 17 Apr 2007 09:41:29 +0000 (19:41 +1000)]
make sure we notify ctdb when a node dies
(This used to be ctdb commit 598feb4fb9badcf329837965ad39e0f0dfe28498)

17 years agomerge from volker and ronnie
Andrew Tridgell [Tue, 17 Apr 2007 09:27:49 +0000 (19:27 +1000)]
merge from volker and ronnie
(This used to be ctdb commit ccc3bef713598f7df6d2e5d83618038d5f25fd68)

17 years agomerge from volker to prevent some valgrind errors
Ronnie sahlberg [Tue, 17 Apr 2007 08:15:08 +0000 (18:15 +1000)]
merge from volker to prevent some valgrind errors

(This used to be ctdb commit ab516a6dcc6871cdbf781892adcd2c77e4c631c2)

17 years agomerge from tridge
Ronnie sahlberg [Tue, 17 Apr 2007 07:38:49 +0000 (17:38 +1000)]
merge from tridge

(This used to be ctdb commit cf0948e73a10d7bc402a4ade4d9a87a7a247bdba)

17 years agoZERO_STRUCT writes one byte too many here.
Volker Lendecke [Tue, 17 Apr 2007 07:36:53 +0000 (09:36 +0200)]
ZERO_STRUCT writes one byte too many here.
(This used to be ctdb commit 3c5c433e5b92f8fe2193a6e5720e31e3eb6bc76b)

17 years agoupdate destination in a redirect reply
Andrew Tridgell [Tue, 17 Apr 2007 07:11:12 +0000 (17:11 +1000)]
update destination in a redirect reply
(This used to be ctdb commit b2836974ad270e823c630e3acf12327b53c37d88)

17 years agostop the client looping (temporary measure)
Andrew Tridgell [Tue, 17 Apr 2007 07:10:50 +0000 (17:10 +1000)]
stop the client looping (temporary measure)
(This used to be ctdb commit 8e6a25f4c4a63145c0dee33453a0693dd395ee68)

17 years agostart using ctdb_ltdb_lock_fetch_requeue()
Andrew Tridgell [Tue, 17 Apr 2007 06:54:03 +0000 (16:54 +1000)]
start using ctdb_ltdb_lock_fetch_requeue()
(This used to be ctdb commit f89ab3a06b4677f56c92768c3a8ae5ec9f5abbc2)

17 years agomerge from tridge
Ronnie sahlberg [Tue, 17 Apr 2007 06:43:53 +0000 (16:43 +1000)]
merge from tridge

(This used to be ctdb commit 268a89db5886955e290538fdc08d3e94172e3527)

17 years agowhen we get a lmaster request, skip updating the header when we are also the new...
Andrew Tridgell [Tue, 17 Apr 2007 06:35:28 +0000 (16:35 +1000)]
when we get a lmaster request, skip updating the header when we are also the new dmaster
(This used to be ctdb commit 6c48dcc5df7b855fc8e0774c9572c7b2af618348)

17 years agowe should not lock in a normal ctdb_call(), as we want them to run concurrently
Andrew Tridgell [Tue, 17 Apr 2007 06:34:53 +0000 (16:34 +1000)]
we should not lock in a normal ctdb_call(), as we want them to run concurrently
(This used to be ctdb commit f4c8c4b3d4c6fb8f1b8e770d1788816af74a7e1f)

17 years ago- send the record header from the client to the daemon when doing a
Andrew Tridgell [Tue, 17 Apr 2007 06:20:32 +0000 (16:20 +1000)]
- 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)

17 years agomerge from tridge
Ronnie sahlberg [Tue, 17 Apr 2007 05:35:06 +0000 (15:35 +1000)]
merge from tridge

(This used to be ctdb commit c4531b6de9189c3cd80862e29d2dd37aab36b9b4)

17 years agomake sure we unlock
Andrew Tridgell [Tue, 17 Apr 2007 05:33:58 +0000 (15:33 +1000)]
make sure we unlock
(This used to be ctdb commit c09054f878a88129abb6cce24c7bbf53f61a2648)

17 years agoblock SIGPIPE in the daemon to prevent a SIGPIPE on write to a dead socket
Andrew Tridgell [Tue, 17 Apr 2007 05:33:20 +0000 (15:33 +1000)]
block SIGPIPE in the daemon to prevent a SIGPIPE on write to a dead socket
(This used to be ctdb commit 02c09dc07c9bed57ca3692b14e41ac8cca0a29f4)

17 years agonow that both daemon and client access the database, it needs to be a real disk file
Andrew Tridgell [Tue, 17 Apr 2007 05:32:49 +0000 (15:32 +1000)]
now that both daemon and client access the database, it needs to be a real disk file
(This used to be ctdb commit 5159f3a61f41bbaf563edd8d901a6bf5bfee4e4e)

17 years agomerge from tridge
Ronnie sahlberg [Tue, 17 Apr 2007 05:02:20 +0000 (15:02 +1000)]
merge from tridge

(This used to be ctdb commit e1ea91fa541a21c8164b8bd26b9c77053e8487cb)

17 years agotidyups in test code
Andrew Tridgell [Tue, 17 Apr 2007 05:01:42 +0000 (15:01 +1000)]
tidyups in test code
(This used to be ctdb commit 43061a4cf9b0995ebe6c86e27f7fc3aacb7bb23e)

17 years ago- removed the non-daemon mode from ctdb, in order to simplify the
Andrew Tridgell [Tue, 17 Apr 2007 04:52:51 +0000 (14:52 +1000)]
- 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)

17 years agomerge from ronnie
Andrew Tridgell [Tue, 17 Apr 2007 02:53:04 +0000 (12:53 +1000)]
merge from ronnie
(This used to be ctdb commit e4ab90e741bfb6b0bb88abb818fe036475cdd0f6)

17 years agocreate symbols for fetch lock response status
Ronnie sahlberg [Tue, 17 Apr 2007 02:42:52 +0000 (12:42 +1000)]
create symbols for fetch lock response status

(This used to be ctdb commit d8243f474897dc65fb7286225b07bdf48b6faed0)

17 years agofinalize fetch lock changes to get rid of the record handle
Ronnie sahlberg [Tue, 17 Apr 2007 02:36:31 +0000 (12:36 +1000)]
finalize fetch lock changes to get rid of the record handle

(This used to be ctdb commit 36c1e98a5533214d5507699dc5d8bdec35cb28c2)

17 years agodo not use a ctdb_record_handle for client fetch_lock/store_unlock any more
Ronnie sahlberg [Tue, 17 Apr 2007 02:22:17 +0000 (12:22 +1000)]
do not use a ctdb_record_handle for client fetch_lock/store_unlock any more

change ctdb_client_fetch_lock to return a status code instead of a record handle and make it unconditionally fill in data.

change ctdb_client_store_unlock to take ctdb_db and key as arguments instead of a record handle

update the ctdb_fetch.c test to use the clientside helpers for fetching and storing data

(This used to be ctdb commit 22d5d40375e0135916c97945646f94119612615d)

17 years agomerge from ronnie
Andrew Tridgell [Tue, 17 Apr 2007 01:54:19 +0000 (11:54 +1000)]
merge from ronnie
(This used to be ctdb commit d854392b04c46bcdd008cced5d16a03d81f97bd0)

17 years agoremaning code to finish lock_fetch/store_unlock clientside helpers
Ronnie sahlberg [Tue, 17 Apr 2007 01:48:27 +0000 (11:48 +1000)]
remaning code to finish lock_fetch/store_unlock clientside helpers

(This used to be ctdb commit edf1e1fea8500461a08cd2795251a5cc0bd10229)

17 years agoinitial change to remove store_unlock pdu and use tdb chainlock in the client
Ronnie sahlberg [Tue, 17 Apr 2007 01:34:45 +0000 (11:34 +1000)]
initial change to remove store_unlock pdu and use tdb chainlock in the client

(This used to be ctdb commit 87dd265d2c61125ca2fa922cfcf9371a234fff0c)

17 years agomerge from ronnie
Andrew Tridgell [Tue, 17 Apr 2007 01:30:19 +0000 (11:30 +1000)]
merge from ronnie
(This used to be ctdb commit fcf3669c27691ddb383d1c585234622efa498d90)

17 years agopartial merge from volker (some overlaps removed)
Andrew Tridgell [Tue, 17 Apr 2007 01:26:59 +0000 (11:26 +1000)]
partial merge from volker (some overlaps removed)

(This used to be ctdb commit c4747460a8e0017acfd2a97a632ecd9395562d4f)

17 years agobetter error handling in ctdb_ltdb_lock_fetch_requeue()
Andrew Tridgell [Tue, 17 Apr 2007 01:20:00 +0000 (11:20 +1000)]
better error handling in ctdb_ltdb_lock_fetch_requeue()
(This used to be ctdb commit 1952be19f625dbe257050acebf468e7e6eb0da8c)

17 years agochange some error printouts to make it easier to determine whether the error occured...
Ronnie sahlberg [Tue, 17 Apr 2007 00:15:44 +0000 (10:15 +1000)]
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)

17 years agomerge from tridge
Ronnie sahlberg [Mon, 16 Apr 2007 23:37:13 +0000 (09:37 +1000)]
merge from tridge

(This used to be ctdb commit 1000ea33025b625e23e7065f95efad447c380c8c)

17 years agoadd an explanation of ctdb_ltdb_lock_fetch_requeue()
Andrew Tridgell [Mon, 16 Apr 2007 23:18:20 +0000 (09:18 +1000)]
add an explanation of ctdb_ltdb_lock_fetch_requeue()
(This used to be ctdb commit 7c749315130a2bc87dcc07460d10dcb089ae4202)

17 years agoadd an explanation of how to use ctdb_lockwait()
Andrew Tridgell [Mon, 16 Apr 2007 23:14:52 +0000 (09:14 +1000)]
add an explanation of how to use ctdb_lockwait()
(This used to be ctdb commit e0c9844ea6270ff506b0b5906aa6ccfcc3bcce7a)

17 years agofixed crash bug - thanks volker
Andrew Tridgell [Mon, 16 Apr 2007 23:10:52 +0000 (09:10 +1000)]
fixed crash bug - thanks volker
(This used to be ctdb commit e293f6fadf673d8bc7203198d709bcb28c26b482)

17 years agodarn, forgot this
Andrew Tridgell [Mon, 16 Apr 2007 21:41:27 +0000 (07:41 +1000)]
darn, forgot this
(This used to be ctdb commit 0feb5da60c0331f6c391622910ca1f436263ce46)

17 years agowait on the right fd ....
Andrew Tridgell [Mon, 16 Apr 2007 14:11:04 +0000 (00:11 +1000)]
wait on the right fd ....
(This used to be ctdb commit 27b67ee6576b17f8b3aae024ae3bd0bb1c42f0f2)

17 years agoadded a ctdb_ltdb_lock_fetch_requeue() function
Andrew Tridgell [Mon, 16 Apr 2007 13:52:14 +0000 (23:52 +1000)]
added a ctdb_ltdb_lock_fetch_requeue() function
this will be the core of the non-blocking lock idea for ctdb, it will be used
in place of ctdb_ltdb_fetch(), but will also get a lock. It re-starts a request
if it needs to block
(This used to be ctdb commit afa479026cf6293e6a878c8a329cdac035284672)

17 years agoadded a tdb_chainlock_nonblock() call to tdb
Andrew Tridgell [Mon, 16 Apr 2007 13:03:36 +0000 (23:03 +1000)]
added a tdb_chainlock_nonblock() call to tdb
(This used to be ctdb commit 6587bdca71d97709c9271a73aea0be5a2a35f399)

17 years agomerge local copy of tdb from samba4 tdb
Andrew Tridgell [Mon, 16 Apr 2007 12:52:58 +0000 (22:52 +1000)]
merge local copy of tdb from samba4 tdb
(This used to be ctdb commit d4619ce98ce44acaebeb6ae9c516a7917bf4e27f)

17 years agofixed a fd bug (thanks volker)
Andrew Tridgell [Mon, 16 Apr 2007 12:49:37 +0000 (22:49 +1000)]
fixed a fd bug (thanks volker)
(This used to be ctdb commit 512a96de1b31e856785749ffc0bed60b1c589f9e)

17 years agomerge from tridge
Ronnie sahlberg [Mon, 16 Apr 2007 06:03:08 +0000 (16:03 +1000)]
merge from tridge

(This used to be ctdb commit 7e60f4ea41707b064e646d0271e81a18f5640aba)

17 years agothis is a demonstration of an idea for handling locks in ctdb.
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.

(This used to be ctdb commit a3248c3e2b740cd2403acffd3c1f6a33dca0ea03)

17 years agomerge from tridge
Ronnie sahlberg [Mon, 16 Apr 2007 04:45:09 +0000 (14:45 +1000)]
merge from tridge

(This used to be ctdb commit 014a255f5e8d97d296d2fe061ab9c2c25494076d)

17 years agomerged from samba4
Andrew Tridgell [Mon, 16 Apr 2007 04:13:10 +0000 (14:13 +1000)]
merged from samba4
(This used to be ctdb commit 541814e6ee3dd7f8f1b3fb615213ff5979b6e22f)

17 years agopull out common command line code for tests into tests/cmdline.c
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
(This used to be ctdb commit de3db72c1fd0e56ac2b8d8fe962c725dc64f2051)

17 years agomerge from tridge
Ronnie sahlberg [Mon, 16 Apr 2007 02:50:48 +0000 (12:50 +1000)]
merge from tridge

(This used to be ctdb commit b40bb042e5a29c61161421d7451368b11ad757e9)

17 years agomerge CTDB_SRVID_ALL patch from Samba4
Andrew Tridgell [Mon, 16 Apr 2007 00:31:39 +0000 (10:31 +1000)]
merge CTDB_SRVID_ALL patch from Samba4
(This used to be ctdb commit 43cd05ab58e940a1ef0352aabe0b63075264a7a0)

17 years ago- fix includes to work in both samba4 and ctdb standalone
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)

(This used to be ctdb commit d85955640e670dd580073da96b25fb8a10c08d18)

17 years agoadded --dblist option to ctdbd, to allow list of databases to be specified on the...
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
(This used to be ctdb commit a19df59e9c2ea24d92a483f8a44514f492d49601)

17 years agomerge from ronnie
Andrew Tridgell [Sun, 15 Apr 2007 22:58:57 +0000 (08:58 +1000)]
merge from ronnie
(This used to be ctdb commit af32b215f67d3bedb1bed542960f3f3813b3f60c)

17 years agoadd code to fetch1 test to tell the two child processes one at a time to fetch_lock...
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

(This used to be ctdb commit b1c0baa03a669757aaacb6e1a2794224f5ba2cd7)

17 years agoadd examples for volker on how to do fetchlock/storeunlock
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

(This used to be ctdb commit 45505520a69a2fbbb1e3a015b54d2133924f46a4)

17 years agoupdate to fetch1.sh test
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

(This used to be ctdb commit 468f68e4607900c5c38aea428a48dd6ea1647411)

17 years agomerge from tridge
Ronnie sahlberg [Sat, 14 Apr 2007 21:41:35 +0000 (07:41 +1000)]
merge from tridge

(This used to be ctdb commit 7e111784a156cc6ed15645db4a911701673d7c2a)

17 years agomerge from ronnie
Andrew Tridgell [Sat, 14 Apr 2007 10:44:43 +0000 (20:44 +1000)]
merge from ronnie
(This used to be ctdb commit 867468a7aadc11d0cb4d9f0eab55d3f34f11d6d3)

17 years agomerge from tridge
Ronnie sahlberg [Fri, 13 Apr 2007 11:10:20 +0000 (21:10 +1000)]
merge from tridge

(This used to be ctdb commit 9c4e5569b82d9c7894e3ac1d5f0783c4d770daf4)

17 years agoprivate -> private_data for samba3
Andrew Tridgell [Fri, 13 Apr 2007 10:38:24 +0000 (20:38 +1000)]
private -> private_data for samba3
(This used to be ctdb commit 080b6901173afb2ad618dd0621876ff478c7d6e5)

17 years agoadd missing code to store_unlock so that the data that a client writes is stored...
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

(This used to be ctdb commit c7a397c56caf71283c081e5b97620085ed5108c6)

17 years agomerge store_unlock code from ronnie
Andrew Tridgell [Fri, 13 Apr 2007 05:49:33 +0000 (15:49 +1000)]
merge store_unlock code from ronnie
(This used to be ctdb commit eb6f05528c14de5145323d0ff93baf6fb89518de)

17 years agoadd more elaborate test to fetch1 test
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

(This used to be ctdb commit f502094499a3c25ab58aa3d192588b5e6dd2b8e4)

17 years agoadd store_unlock pdu's for the domain socket.
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

(This used to be ctdb commit 167d6993e78f6a1d0f6607ef66925a14993ae6a1)