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

201 Commits

Author SHA1 Message Date
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
Andrew Tridgell
3fc279760c better error handling in ctdb_ltdb_lock_fetch_requeue()
(This used to be ctdb commit 1952be19f625dbe257050acebf468e7e6eb0da8c)
2007-04-17 11:20:00 +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
71bf837a19 add an explanation of ctdb_ltdb_lock_fetch_requeue()
(This used to be ctdb commit 7c749315130a2bc87dcc07460d10dcb089ae4202)
2007-04-17 09:18:20 +10:00
Andrew Tridgell
a024989597 add an explanation of how to use ctdb_lockwait()
(This used to be ctdb commit e0c9844ea6270ff506b0b5906aa6ccfcc3bcce7a)
2007-04-17 09:14:52 +10:00
Andrew Tridgell
7db4320e84 fixed crash bug - thanks volker
(This used to be ctdb commit e293f6fadf673d8bc7203198d709bcb28c26b482)
2007-04-17 09:10:52 +10:00
Andrew Tridgell
4c787fdff5 darn, forgot this
(This used to be ctdb commit 0feb5da60c0331f6c391622910ca1f436263ce46)
2007-04-17 07:41:27 +10:00
Andrew Tridgell
fca41760e3 wait on the right fd ....
(This used to be ctdb commit 27b67ee6576b17f8b3aae024ae3bd0bb1c42f0f2)
2007-04-17 00:11:04 +10:00
Andrew Tridgell
8147d033a3 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)
2007-04-16 23:52:14 +10: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
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
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
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
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
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
Andrew Tridgell
6402915bb6 merge from vl
(This used to be ctdb commit 8b5233fbe773893d1bc6b377f8956fe0b3e503ab)
2007-04-12 10:51:55 +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
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
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
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
Ronnie sahlberg
4b6fbe7be1 create a standalone ctdb daemon and a script ./direct/ctdbd.sh to start two such daemons in a 2 node cluster.
create a small test application that connects to the ctdb daemon at /tmp/ctdb.socket.127.0.0.1 and do some commands to the daemon.
currently this test tool only opens the socket and registers its pid with the daemon
(the daemon needs to know the pid so that it can forward messages to the correct client)

the test will be extended with additional ctdb commands

(This used to be ctdb commit 801f6127cdd50c5b2d0e64dd8db08500af9dadc9)
2007-04-11 18:54:22 +10:00
Andrew Tridgell
a91412cb04 added --num-clients option to ctdb_messaging test
(This used to be ctdb commit 2f4e7e34071c8950f6c4d64469c5eb15d0888113)
2007-04-11 15:23:50 +10:00