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

222 Commits

Author SHA1 Message Date
Peter Somogyi
a32fa3451d merged tridge's branch
(This used to be ctdb commit 15e18293eaa5ddcd325395213014b5a4498ca309)
2007-04-16 16:28:29 +02:00
Andrew Tridgell
7aa68f96f7 added a tdb_chainlock_nonblock() call to tdb
(This used to be ctdb commit 6587bdca71d97709c9271a73aea0be5a2a35f399)
2007-04-16 23:03:36 +10:00
Andrew Tridgell
8d2501e025 merge local copy of tdb from samba4 tdb
(This used to be ctdb commit d4619ce98ce44acaebeb6ae9c516a7917bf4e27f)
2007-04-16 22:52:58 +10:00
Andrew Tridgell
b3ed006ef4 fixed a fd bug (thanks volker)
(This used to be ctdb commit 512a96de1b31e856785749ffc0bed60b1c589f9e)
2007-04-16 22:49:37 +10:00
Andrew Tridgell
07ade5e488 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)
2007-04-16 16:01:37 +10:00
Andrew Tridgell
9cc94483de merged from samba4
(This used to be ctdb commit 541814e6ee3dd7f8f1b3fb615213ff5979b6e22f)
2007-04-16 14:13:10 +10:00
Andrew Tridgell
36cfd2cc64 pull out common command line code for tests into tests/cmdline.c
(This used to be ctdb commit de3db72c1fd0e56ac2b8d8fe962c725dc64f2051)
2007-04-16 14:12:50 +10:00
Andrew Tridgell
f62bb4e8fc merge CTDB_SRVID_ALL patch from Samba4
(This used to be ctdb commit 43cd05ab58e940a1ef0352aabe0b63075264a7a0)
2007-04-16 10:31:39 +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
5f592876d1 added --dblist option to ctdbd, to allow list of databases to be specified on the command line
(This used to be ctdb commit a19df59e9c2ea24d92a483f8a44514f492d49601)
2007-04-16 09:29:10 +10:00
Andrew Tridgell
806d55ee34 merge from ronnie
(This used to be ctdb commit af32b215f67d3bedb1bed542960f3f3813b3f60c)
2007-04-16 08:58:57 +10:00
Ronnie sahlberg
18595074d3 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)
2007-04-16 08:37:27 +10:00
Ronnie sahlberg
01c12982a6 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)
2007-04-15 14:39:23 +10:00
Ronnie sahlberg
fc866963fa 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)
2007-04-15 14:02:39 +10:00
Ronnie sahlberg
986d99a0ff merge from tridge
(This used to be ctdb commit 7e111784a156cc6ed15645db4a911701673d7c2a)
2007-04-15 07:41:35 +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
Andrew Tridgell
de058569e0 merge store_unlock code from ronnie
(This used to be ctdb commit eb6f05528c14de5145323d0ff93baf6fb89518de)
2007-04-13 15:49:33 +10:00
Ronnie sahlberg
673b879a3f 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)
2007-04-13 09:44:56 +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
d4dfaaf76f merge from tridge
(This used to be ctdb commit e7c318394b51936c7afef9451b8e32c42fac9829)
2007-04-12 21:35:16 +10:00
Andrew Tridgell
fadb253e3e merge from ronnie
(This used to be ctdb commit 8a6d3a2766d878f15892bf070536fd121424c9f7)
2007-04-12 21:32:16 +10:00
Ronnie sahlberg
ba162178b9 add the two missing file from the previous commit
(This used to be ctdb commit 3753b64e4e64446dc1f20ec92b45ba11bc0e0be5)
2007-04-12 21:19:00 +10:00
Ronnie sahlberg
91b7cc8b27 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

(This used to be ctdb commit 996f117d9181dee22aea979ce04333035f5522c7)
2007-04-12 21:17:10 +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
109ff6ed43 merge from tridges tree
(This used to be ctdb commit 63669f4b965fd03503bdbfe389243750c376a289)
2007-04-12 17:13:48 +10:00
Andrew Tridgell
4090b35458 merge from ronnie
(This used to be ctdb commit 0e351d1655e380fbb35e45d15f4ba3ccc15097e4)
2007-04-12 16:51:33 +10:00
Ronnie sahlberg
1116851c19 dont hardcode gdb in the test script. ooops
(This used to be ctdb commit e193d69cd8cdd293379ab88d25e6984b584afa22)
2007-04-12 16:49:37 +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
Ronnie sahlberg
8bd2faf771 merge from volker
(This used to be ctdb commit c59e92829364aefdd4f8f4972b47135faca69006)
2007-04-12 10:52:19 +10:00
Andrew Tridgell
6402915bb6 merge from vl
(This used to be ctdb commit 8b5233fbe773893d1bc6b377f8956fe0b3e503ab)
2007-04-12 10:51:55 +10:00
Andrew Tridgell
799312060d merge from ronnie
(This used to be ctdb commit b4c9dd2f2c014039afca3a225375a4aefee14113)
2007-04-12 10:44:18 +10:00
Ronnie sahlberg
51c660d1a1 add an example on how to read a message from the domain socket
(This used to be ctdb commit 9723828b1562eb6a386eb26e63db3b6617ebb454)
2007-04-12 09:09:27 +10:00
Ronnie sahlberg
e18ed8cc84 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
(This used to be ctdb commit 26ffd166c176deb7e2437f3ee87887f8b57435e7)
2007-04-12 08:44:15 +10:00
Ronnie sahlberg
5370e677ec add a test message to the messaging test so we can see that the message data is also passed from originator to receiver
(This used to be ctdb commit f9c2ed3cff8eb481bfa80d944d86233e2a7d5d00)
2007-04-12 08:28:54 +10:00
Ronnie sahlberg
e4544f6bfe merge from ridge and vl
(This used to be ctdb commit 8d407c5858a20c9757024f19033b5ef174ec3681)
2007-04-12 07:49:28 +10:00
Volker Lendecke
d8dd8fbe49 Rename "private" to "private_data"
(This used to be ctdb commit 78cf4443ac0c66fb750ef6919bcdec189ac219c9)
2007-04-11 20:12:15 +02:00
Volker Lendecke
a5d1b2ce48 Merge tridge's tree
(This used to be ctdb commit 63a59a700a1fb4c23cd76d99c5b4c9660c7ca475)
2007-04-11 16:52:06 +02:00
Volker Lendecke
6961f32eb7 Add a test to read back the message
Volker

(This used to be ctdb commit b7f134fe6e160d7ec70c466f8f3e7fb3dabd0774)
2007-04-11 16:51:25 +02:00
Andrew Tridgell
230c1a75d1 use event_loop_wait instead of while(1)
(This used to be ctdb commit e49a6436483bffcf867fbb746ef43a5356055857)
2007-04-11 22:21:43 +10:00
Andrew Tridgell
2aa26b0ae7 use lib/replace for signal.h
(This used to be ctdb commit 4c660b9706ef09527b8e1a2837d844d30672c541)
2007-04-11 22:19:46 +10:00
Andrew Tridgell
d0be3abcf7 merge from volker
(This used to be ctdb commit 68bc5b4d0d2049ebcee19338f744efd5b129725a)
2007-04-11 22:17:24 +10:00
Andrew Tridgell
473ca4e3f7 merge from ronnie
(This used to be ctdb commit 6cd4b1ec40b51f491d25173a7dde0864f525e7ef)
2007-04-11 22:11:07 +10:00
Volker Lendecke
2597931dfd merge
(This used to be ctdb commit 89c24a2ee211126d24e770abb8f91c5575126246)
2007-04-11 13:57:58 +02: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
Volker Lendecke
f2d13d0ea9 Fix uninitialized variable warnings
(This used to be ctdb commit b84f97adfd25b2fbfab1c7964b68931643e8029c)
2007-04-11 12:49:10 +02:00
Ronnie sahlberg
6e2463e5c7 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.

(This used to be ctdb commit 9d8821bfd1456591fb5c31f0c6c3fd63e99dc4fb)
2007-04-11 20:32:24 +10:00
Ronnie sahlberg
fbb1d9e50d add call/reply parsing of the cluster connect-wait call to the test daemon.
(This used to be ctdb commit c54c87feb89b8d97655c1fcd748a295119a1171f)
2007-04-11 19:27:19 +10:00