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

299 Commits

Author SHA1 Message Date
Andrew Tridgell
76b2822340 - startup frozen, and do an initial recovery
- fixed a bug in traverse
- get a lock on the node list file in the recmaster recovery daemon

(This used to be ctdb commit 162a5647535ad1cb3e8e5d4042a2784365fb1913)
2007-05-23 14:35:19 +10:00
Andrew Tridgell
9f7a70657f start ctdb frozen, and let the election sort things out. This prevents a race on startup
(This used to be ctdb commit b788ed3fa64e31e517b4e602e8bd3ae7201ecddd)
2007-05-23 12:23:07 +10:00
Ronnie Sahlberg
e989a1bac8 add controls to enable/disable the monitoring of dead nodes
(This used to be ctdb commit 79d29c39bb81feb069db3fc6d3d392c1e75a4d13)
2007-05-21 09:24:34 +10:00
Andrew Tridgell
d549f1e1a3 merge from ronnie
(This used to be ctdb commit 985d718e03510398b9a5cfdf6a4d559a90738a11)
2007-05-19 17:21:58 +10:00
Ronnie Sahlberg
02a9f1b0a0 use ctdb_dead_node() instead of reimplementing the same code again
this leaves only one single function where a node is marked as dead
instead of two places

(This used to be ctdb commit aa764ea26cc26d5c1ae188105236da603576f45b)
2007-05-19 16:59:10 +10:00
Andrew Tridgell
a14fd9d29c make sure we don't increment rx_cnt for redirected packets, or for packets that have been requeued after a lockwait
(This used to be ctdb commit 92e5569407dba173a27e9645b4339ce3e2c00520)
2007-05-19 13:45:24 +10:00
Ronnie Sahlberg
9f7b9faf64 add a node->tx_cnt counter
only send keepalive packets if the count is zero

(This used to be ctdb commit 2cbd424231caccf0a531cf6501761115efe68f3e)
2007-05-19 10:20:19 +10:00
Andrew Tridgell
28f2fc669b a better way to resend calls after recovery
(This used to be ctdb commit 444f52e134fc22aaf254d05c86d8b357ded876f4)
2007-05-19 00:56:49 +10:00
Andrew Tridgell
049e1504ee timeout pending controls immediately when a node becomes disconnected
(This used to be ctdb commit 93c4b16f4efef383ba8db83953019ef4821613e0)
2007-05-18 23:48:29 +10:00
Andrew Tridgell
346dfc1bef - up rx_cnt on all packet types
- notice when a node becomes available again

(This used to be ctdb commit e05110dd6112e81f224937dfd7370d963ce9531a)
2007-05-18 23:23:36 +10:00
Ronnie Sahlberg
db4c479568 add dead node detection so that if a node does not generate any
keepalive traffic for x seconds   it is deemed dead


this triggers a recovery after a while if a ctdbd has been STOPPED    
but it doesnt recover automatically when the node reappears

(This used to be ctdb commit d6324afe0d13b5e21d06e347caca433c6b36a32a)
2007-05-18 19:19:35 +10:00
Andrew Tridgell
49fe66713f - don't try to send controls to dead nodes
- use only connected nodes in a traverse

(This used to be ctdb commit 9a676dd5d331022d946a56c52c42fc6985b93dbc)
2007-05-17 23:23:41 +10:00
Andrew Tridgell
874fd5c2f7 removed the CTDB_CTRL_FLAG_NOREQUEUE flag
(This used to be ctdb commit 366e849f6f350eda78d79cf1ea55c2637e605c86)
2007-05-17 14:10:38 +10:00
Ronnie Sahlberg
f4738f9c41 we no longer pass lmaster across during pulldb so dont print it from
catdb either

(This used to be ctdb commit b57d60f4789ea7f0dd69c93f6629d8742e182576)
2007-05-17 12:07:29 +10:00
Ronnie Sahlberg
cc760cf13a add a control to shutdown/kill a node
(This used to be ctdb commit 3802f7304fd59d56062c855987e2561753e85a69)
2007-05-17 10:45:31 +10:00
Ronnie Sahlberg
d6ed77468d merge from tridge
(This used to be ctdb commit 0c6dc471e33e80db00a2b006262c4107f39fa023)
2007-05-16 18:44:51 +10:00
Andrew Tridgell
c105f6d789 - merge from ronnie
- fixed a memory leak found by dmitry

(This used to be ctdb commit ae87bf0005666b50850161c3843d6bc7cb5c8971)
2007-05-16 18:10:26 +10:00
Ronnie Sahlberg
f4056d2e28 remove a prototype we no longer need
(This used to be ctdb commit 4a11373ec5e8196cf430f18f6171915f790f794b)
2007-05-16 14:45:43 +10:00
Ronnie Sahlberg
a4ebb6d5ef if a caller specifies a timeout when calling a control, it makes no
sense to have the daemon requeue the packets if they timeout or fail to 
deliver to the remote node

(This used to be ctdb commit 9fb753046787190970654aeb937e96685ac53184)
2007-05-16 12:34:30 +10:00
Ronnie Sahlberg
4b8ddfccad merge from tridge
(This used to be ctdb commit 8d424b41d6cf2973b28a749d1b8e6a028dad9ffe)
2007-05-16 11:12:28 +10:00
Andrew Tridgell
a5198559c9 moved the recovery daemon into the main ctdbd and enable it by default
(This used to be ctdb commit 2a7d42124731f43d013cb76a798525eab4cc1ee0)
2007-05-15 15:13:36 +10:00
Ronnie Sahlberg
0d71b6d1e6 merge from tridge
(This used to be ctdb commit 0697f59a044deeab126a39bff97bcd5c1101298e)
2007-05-15 10:28:41 +10:00
Andrew Tridgell
c6afe22b92 added a control to get the local vnn
(This used to be ctdb commit 0b109f574b710f290372512d0694290ea7cd4368)
2007-05-15 10:17:16 +10:00
Andrew Tridgell
cf1056df94 added a -i switch to run ctdbd without forking
(This used to be ctdb commit 327df14ecd58f405fbe8b38afa2ee54a8dd0a2e4)
2007-05-15 09:44:33 +10:00
Ronnie Sahlberg
ed466e20b6 remove the control to bump the rsn since we dont need it anymore
(This used to be ctdb commit a646b6d77bd8adf6c986259c534a05400c4bde11)
2007-05-14 08:03:48 +10:00
Ronnie Sahlberg
4f7fc688f7 merge from tridge
(This used to be ctdb commit 7bca79ad6357149fd7c6b28ce4b05de3d223a7de)
2007-05-14 06:25:15 +10:00
Andrew Tridgell
81826da2df added error messages in ctdb_control replies
(This used to be ctdb commit bd848f5b760e6b2a73ebfc67fd8adb3c31479fb5)
2007-05-12 21:25:26 +10:00
Andrew Tridgell
36ccc10389 make sure we ignore requeued ctdb_call packets of older generations except for packets from the client
(This used to be ctdb commit facab105fbd7fe50f96bdd763ae50ddc54fbdacc)
2007-05-12 18:08:50 +10:00
Andrew Tridgell
2c90d9e794 show total frozen/recoving in status
(This used to be ctdb commit 0d0eb66a63fe6912edb85bf7387ac76acb70babd)
2007-05-12 15:51:08 +10:00
Andrew Tridgell
9cf77dd23f separate out the freeze/thaw handling from recovery
(This used to be ctdb commit 0b0640bd8b8334961f240e0cf276ac112cd6e616)
2007-05-12 15:15:27 +10:00
Andrew Tridgell
74a799a83b added lockwait child code for entering recovery mode. A child processes holds lockall locks for the entire recovery process
(This used to be ctdb commit f892f30def75b0d964c35eae38c4cf675597dd28)
2007-05-12 14:34:21 +10:00
Ronnie Sahlberg
9ec3024287 add a control to bump the rsn number for all records in a database
use this control from the recovery daemon to ensure that the recmaster 
always have a higher rsn than andy other node for the records after 
recovery completes

(This used to be ctdb commit 6fb6a8b981a804bfcc460c4481c51c7c647230f6)
2007-05-11 10:36:47 +10:00
Andrew Tridgell
f8765b19bf - got rid of the complex hand marshalling in the recovery controls
- fixed the re-send of ctdb calls after a generation change

- fixed a reqid idr leak in controls

- removed the write_record test code

- use the new nonblock lockall code to prevent ctdbd from ever doing a
  blocking lock that could deadlock with smbd

- moved more of the recovery controls into ctdb_recover.c

(This used to be ctdb commit 565a21aa4f1e842309986ab97d6244801153deec)
2007-05-10 17:43:45 +10:00
Andrew Tridgell
15bc97cdaa better timeout handling for calls, controls and traverses
(This used to be ctdb commit 63346a6c59d4821b4c443939b5d88db8cd20f5fe)
2007-05-10 14:06:48 +10:00
Andrew Tridgell
31cd92dc7e merge from ronnie
(This used to be ctdb commit 92b7a849565730744c75a7fb776173554e9f57bf)
2007-05-10 13:15:58 +10:00
Andrew Tridgell
682df74d59 separate the wire format and internal format for the vnn_map
(This used to be ctdb commit 9a71718d87c5162f1423d85c2e86a01f6771925e)
2007-05-10 08:13:19 +10:00
Andrew Tridgell
d2a90cc5a5 merge from ronnie
(This used to be ctdb commit f67a4842e7b1efb2ad61c41e4895c7698e564bf3)
2007-05-09 11:54:37 +10:00
Ronnie Sahlberg
6929739b7f add a command line flag to ctdbd to start a recovery daemon.
update the recovery test script to start all ctdb daemons with a 
recovery daemon

(This used to be ctdb commit 47794e16df285cacefc30208d892d931a6e46b96)
2007-05-09 09:59:23 +10:00
Andrew Tridgell
fdb8144e62 fixed a problem with the number of timed events growing without bound with the new seqnum code
(This used to be ctdb commit 6109ae3dae8d93c93a2dc76cc561ea6e21458aa6)
2007-05-08 21:16:29 +10:00
Ronnie Sahlberg
39d81cffb1 recovery daemon with recovery master election
election is primitive, it elects the lowest vnn as the recovery master

two new controls, to get/set recovery master for a node



to use recovery daemon,   start one  
./bin/recoverd --socket=ctdb.socket*
for each ctdb daemon


it has been briefly tested by deleting and adding nodes to a 4 node 
cluster but needs more testing

(This used to be ctdb commit 541d1cc49d46d44042a31a8404d521412ef2fdb3)
2007-05-07 06:51:58 +10:00
Ronnie Sahlberg
a9657f6aa5 add new controls to get and set the recovery master node of a daemon
i.e. which node is "elected" to check for and drive recovery

(This used to be ctdb commit d577093eb4b619392c71ab5ce81e8c02565d93f0)
2007-05-07 05:02:48 +10:00
Ronnie Sahlberg
25edbc9a50 add a control to get the pid of a daemon.
this makes it possible to kill a specific daemon in the recover test 
script

(This used to be ctdb commit 2fa394b4c80988cb1a6d04b236ec64cc9d9e8a40)
2007-05-06 04:31:22 +10:00
Ronnie Sahlberg
2e64727079 merge from tridge
(This used to be ctdb commit 8648104f8d76d22427c14422b126f7e979cc2d95)
2007-05-05 16:51:34 +10:00
Andrew Tridgell
9636c97c5a show number of connected clients in status output
(This used to be ctdb commit 99765bbe327bfe9c43415f4943281458f25be51b)
2007-05-05 14:09:46 +10:00
Ronnie Sahlberg
5cb817f031 split the vnn broadcast address into two
one broadcast address for all nodes
and one broadcast address for all nodes in the current vnnmap

update all useage of the old flag to now only broadcast to the vnnmap
except for tools/ctdb_control where it makes more sense to broadcast to 
all nodes

(This used to be ctdb commit dfb65b88cf67ad9d61268c4b47a6d8ae346f47df)
2007-05-05 13:17:26 +10:00
Andrew Tridgell
410d41480a added a dumpmemory control, used to find memory leaks
(This used to be ctdb commit 44fdafaf421e3e906796d529aed2f7c5df201b94)
2007-05-05 11:03:10 +10:00
Andrew Tridgell
adc64aed0a - fixed a crash bug after client disconnect in ctdb_control
- added total memory used to ctdb_control status output

(This used to be ctdb commit a99ffe4372edc63d83d8c8ebf9a60b3413301f5a)
2007-05-05 08:33:35 +10:00
Andrew Tridgell
d8f4e6b209 - added counters for controls in ctdb_control status
(This used to be ctdb commit 858061372fc9902837a1a5b8bcfc0ada58eec193)
2007-05-05 08:11:54 +10:00
Ronnie Sahlberg
1725fcf294 merge from tridge
(This used to be ctdb commit 62574808ef4dcb76760f1dd2496fbe8e34197c23)
2007-05-05 01:22:30 +10:00
Andrew Tridgell
fccc585f5a added seqnum propogation code to ctdb
(This used to be ctdb commit be2572b1b09eaaa1ea6a726d60f16996f9407d13)
2007-05-04 22:18:00 +10:00
Ronnie Sahlberg
508cafd17e merge from tridge
(This used to be ctdb commit 6c8b90cedc67daa89d54db5268fde18bfc20abaf)
2007-05-04 17:05:28 +10:00
Andrew Tridgell
ed3e847785 added a ctdb control for enabling the tdb seqnum
(This used to be ctdb commit c66920d9fb08a4a33418e2c1dcf1fc320fba3761)
2007-05-04 15:33:28 +10:00
Ronnie Sahlberg
7dfdab1b9d recovery daemon
this program is a client to the local ctdb daemon

every second it pulls all vnnmap and nodemaps from all nodes that are 
available and checks if a recovery is required

a recovery is required if :
* all nodes do NOT have an identical vnnmap and generation
* all nodes do NOT have an identical nodemap
* there are active nodes that are NOT in the nodemap
* there are nodes in the nodemap that are NOT active

During recovery,  the recovery tool will also make sure that all nodes 
know about and have created all databases.

(This used to be ctdb commit 2f2650467bac7e8954de7c17cb34f46b0bdbcd26)
2007-05-04 15:21:40 +10:00
Andrew Tridgell
f2fd53056d nicer interface to ctdb traverse
(This used to be ctdb commit e5ce866dcc5037b5069e42bf1e168b646f007b01)
2007-05-04 12:18:39 +10:00
Andrew Tridgell
e752f3bd97 - changed the REQ_REGISTER PDU to be a control
- allow controls to know which client invoked them

- added a client_id to clients, so they can be identified remotely

- added the ability to remove registered srvids

- in the list_keys code, register a temp srvid, then remove it afterwards

(This used to be ctdb commit 29603c51cc6d81362532cd8e50f75c8360c5f5ef)
2007-05-04 11:41:29 +10:00
Ronnie Sahlberg
2b1714a521 update getvnnmap control to take a timeout parameter
dont explicitely free the vnnmap pointer in the getvnnmap control  this 
is freed by the mem_ctx instead

add code to the recoverd to detect when/if recovery is required
veiry that the number of active nodes, the nodemap and the vnn map is 
consistent across the entire cluster and if not   trigger a recovery 
(which right now just prints "we need to do recovery" to the screen.

(This used to be ctdb commit 2b0a207a3748bdb3394dc9fd0d1c344ee1bb0bb5)
2007-05-04 09:45:53 +10:00
Ronnie Sahlberg
ae73784c28 change the signature for ctdb_ctrl_getnodemap() so that a timeout
parameter is added.
change ctdb_get_connected_nodes in the same way

(This used to be ctdb commit d85f23bcf4c1230225abb2f4a053c70b68d469aa)
2007-05-04 09:01:01 +10:00
Ronnie Sahlberg
ebc478749b start working on a recovery daemon
change ctdb_control so it takes a timeval pointer as argument.
this is the timeout. if the node has not responded within hte timeout
ctdb_control will return an error instead of hanging.
if the timeval pointer is NULL then the call will block indefinitely if 
there is no response.

this is used for now in the createdb control   but all the helpers 
ctdb_ctrl_* should probably be updated to take a timeout parameter as 
well.

(This used to be ctdb commit 1fe64b04869b17dbf123851b0fe09df8d28a6211)
2007-05-04 08:30:18 +10:00
Ronnie Sahlberg
63f42d3ff8 merge from tridge
(This used to be ctdb commit fb8ac93c7dfc11e774ef1ce05b0d0df1de56a621)
2007-05-03 17:16:38 +10:00
Andrew Tridgell
60b42276eb first version of traverse is working
(This used to be ctdb commit ecac90cee389a6fa0e9b1efba521e098a24d323f)
2007-05-03 17:12:23 +10:00
Ronnie Sahlberg
14724b504b cleanup the control "write record"
(This used to be ctdb commit 4dd5c26a21a5dc2b2f76eb23cfeb4df82ba4e956)
2007-05-03 16:18:03 +10:00
Andrew Tridgell
486c6b4fce merged from ronnie
(This used to be ctdb commit 57a80110ddfd202f8de37297db76dc43a064e476)
2007-05-03 13:53:54 +10:00
Ronnie Sahlberg
d88154b24a cleanup getnodemap
(This used to be ctdb commit 3867ccf71a167fb82dbc5a3f03f968a325a0c70b)
2007-05-03 13:30:38 +10:00
Ronnie Sahlberg
633ae7f346 fixup getdbmap control so it looks a bit nicer
(This used to be ctdb commit 78a4d61cb78da20af5210488e685c91bc3023e90)
2007-05-03 13:07:34 +10:00
Andrew Tridgell
472b96d6d3 first stage of efficient non-blocking ctdb traverse
(This used to be ctdb commit 4c23e6f26bde421bb56b55de9d6cd3e319b2be40)
2007-05-03 12:16:03 +10:00
Ronnie Sahlberg
27880056db break set/get vnn map out from ctdb_control and put it in ctdb_recover.c
for the time being

remove all the [de]marshalling and just pass a structure around instead

(This used to be ctdb commit b1169555ab7015976c0135ff51121cc238f5887c)
2007-05-03 11:06:24 +10:00
Ronnie Sahlberg
768eb0f763 merge from tridge
(This used to be ctdb commit 17b73a811009588f836c3f9fd1b775d9d504d30c)
2007-05-02 22:00:48 +10:00
Ronnie Sahlberg
206fb1fd3b add a recover test change alignment for the pull/push db structures
(This used to be ctdb commit 0eb45623ca103e69765ed577ae02e7f8ca777e37)
2007-05-02 21:00:02 +10:00
Andrew Tridgell
317ad52758 added a builtin fetch function to support samba3 unlocked fetch
(This used to be ctdb commit 8c57a8355a94a7d714b9bec98533bc40a2bc4684)
2007-05-02 15:11:11 +10:00
Ronnie Sahlberg
d20990c2b6 add a control to create a database
(This used to be ctdb commit 74e489c6737cc79537c7812ea82daafb1b363ec2)
2007-05-02 12:43:35 +10:00
Ronnie Sahlberg
599fa31266 update some calls to ctdb_control() that were still using the old
signature (flags field)

update some calls to ctdb_get_config() to use the new name 
ctdb_ctrl_get_config()

change #include "talloc/talloc.h" to #include "lib/talloc/talloc.h" in 
lib/events/events.h

(This used to be ctdb commit d2cdd87037b9f0c387228d7d4743da4869929c93)
2007-05-02 11:02:04 +10:00
Ronnie Sahlberg
3a891c6676 merge with tridges tree to resolve all conflicts
(This used to be ctdb commit 0f7c6c580ef0de60af68fd22bce36c0c0b2515b0)
2007-05-02 10:53:29 +10:00
Ronnie Sahlberg
51630f9b12 add an initial recovery control to perform samba3 style recovery
this is not optimized at all and copies/merges all records between 
databases instead of only those records for which a certain node is 
lmaster.  (step 7 should later be enhanced to a, delete the database, 
push only those records for which the node is lmaster)

(This used to be ctdb commit 509d2c71169e96a8610f9db91293dc7a73c2cc10)
2007-05-02 10:20:34 +10:00
Andrew Tridgell
169f129404 merge latest versions of lib/replace, lib/talloc, lib/tdb and lib/events into ctdb bzr tree
(This used to be ctdb commit eaea8a9fa8d2f5e08f3af619fa1008a663f39053)
2007-05-02 07:32:04 +10:00
Andrew Tridgell
2dc24c7d56 added a hopcount in ctdb_call
(This used to be ctdb commit 36d838801a2a2008c50322cdbfff65a308b1cd1a)
2007-05-01 13:25:02 +10:00
Andrew Tridgell
9366120d92 changed the way set_call and attach are done so that you can safely
attach to databases after the protocol has started. The daemon
broadcasts information on new databases to the other daemons.

This also eliminates the need for the client to know about the hash
between db name and db_id.

(This used to be ctdb commit 3bad91a9d987d4c09fe3322eac23c2733660ad08)
2007-04-30 15:31:40 +02:00
Andrew Tridgell
f455d3f44b saner logfile code
testing of ctdbd

(This used to be ctdb commit 05789da5818f8b20f04779b0df5125914d9047f6)
2007-04-29 22:42:23 +02:00
Ronnie Sahlberg
eacfcaf437 add push/pull of tdb and a control to copy a tdb from one node to
another node

(This used to be ctdb commit c313daff4c1362cd08a9f682ce04cab312678038)
2007-04-30 00:58:27 +10:00
Andrew Tridgell
e21f69107f yay! finally fixed the bug that volker, ronnie and I have been chasing
for 2 days.

The main bug was in smbd, but there was a secondary (and more subtle)
bug in ctdb that the bug in smbd exposed. When we get send a dmaster
reply, we have to correctly update the dmaster in the recipient even
if the original requst has timed out, otherwise ctdbd can get into a
loop fighting over who will handle a key.

This patch also cleans up the packet allocation, and makes ctdbd
become a real daemon.

(This used to be ctdb commit 59405e59ef522b97d8e20e4b14310a217141ac7c)
2007-04-29 16:19:40 +02:00
Ronnie Sahlberg
f67a79ad8e merge from tridge
(This used to be ctdb commit a84e9b47a87fc7d4756b4a179aa2ea0bc7c54c78)
2007-04-29 23:49:27 +10:00
Ronnie Sahlberg
77ce5750b2 add a new "recovery mode" field to ctdb.
while recovery is in progress  the daemon will discard all CTDB_REQ_CALL 
and rely on clients retransmitting them

add new controls to get/set the recovery mode

(This used to be ctdb commit 41458a61577885ac49150f830e92e93e634c5411)
2007-04-29 22:51:56 +10:00
Ronnie Sahlberg
1af701291f implement a control to pull a database from a remote node
it does not yet work since ctdb_control can right now only be called 
from client context and the pull is implemented as the target ctdb node 
itself using a get_keys to pull the keys from the source node   thus 
ctdb daemon needs to ctdb_control to a remote node

(This used to be ctdb commit a55c7c64b4ff87f54b90649c9f469b1ff36dc9ea)
2007-04-29 22:14:51 +10:00
Ronnie Sahlberg
376a3ea852 control to delete all records in a database
(This used to be ctdb commit 6664e00fc02e1c60cc1a35ecd15f4893a34f23d1)
2007-04-29 18:48:46 +10:00
Ronnie Sahlberg
c0b0b4a0f5 add a new control to set all records in a database to a new dmaster
(This used to be ctdb commit fd0d2385206b0329b74d908f3bdf89d3f32095d1)
2007-04-29 18:34:11 +10:00
Ronnie Sahlberg
097037a055 add a control to read an entire tdb from a node including
key/lmaster/header and data

(This used to be ctdb commit ac00d6271ba6356c1edf804df44d0d2600791610)
2007-04-29 05:47:13 +10:00
Andrew Tridgell
10910f52eb added reset status control
(This used to be ctdb commit ec342b667a085a5c740fbeec8882070571071862)
2007-04-28 19:13:36 +02:00
Andrew Tridgell
1627a5d749 removed unnecessary variable
(This used to be ctdb commit ef0027faa631b00c7fc1a7c4538fbf3080248f0b)
2007-04-28 18:55:37 +02:00
Andrew Tridgell
6e09bfdaf9 much simpler redirect logic
(This used to be ctdb commit 95db9afa7dd039e1700e2f3078782f6ac66e9f51)
2007-04-28 18:18:33 +02:00
Andrew Tridgell
1e538be42d better name for this hack
(This used to be ctdb commit e5a98eee991a7926ddb6964ea3785b11303d175e)
2007-04-28 17:46:37 +02:00
Andrew Tridgell
c885b159f4 use ctdb_get_connected_nodes for node listing
(This used to be ctdb commit b4efdd1944207e51dccd6cd5e50f451a7dddcd91)
2007-04-28 17:42:40 +02:00
Andrew Tridgell
4b6d00974d added status all and debug all control operations
(This used to be ctdb commit 7f902f6c4270adc0543096c78415d335b88d6232)
2007-04-28 17:13:30 +02:00
Andrew Tridgell
e6d5848a20 report number of clients in ping
(This used to be ctdb commit 9deaa1892faa8288cad9f6fde20d2aa8ba8af699)
2007-04-28 15:15:21 +02:00
Ronnie Sahlberg
acb4bc095b add a few more controls that are useful for debugging a cluster
(This used to be ctdb commit 751c1365ab55a217ff33d985d52bd26581578617)
2007-04-28 20:40:26 +10:00
Ronnie Sahlberg
643bfe83d3 add a control to pull the database list from a remote node
(This used to be ctdb commit d130e02936ea4bdcd3a6f02c53be4b7771993138)
2007-04-28 20:00:50 +10:00
Andrew Tridgell
353a82f87c factor out the packet allocation code
(This used to be ctdb commit 4cbaf22cc4bede8c95dd9b87e21bbe886307e23b)
2007-04-28 10:50:32 +02:00
Andrew Tridgell
a8de91b83f merge from ronnie
(This used to be ctdb commit 9253714401de1d7fea6ad44c35f324004683abd7)
2007-04-28 09:54:45 +02:00
Ronnie Sahlberg
916c55ec2f add a generation field to the pdu header.
this will allow a node to verify that a received pdu is sent from a node 
in the same generation instance of a cluster.

(This used to be ctdb commit e32d3ca9a622237c4e2622de98825c0962760d48)
2007-04-28 01:06:26 +10:00
Andrew Tridgell
e629252b2c merge from ronnie
(This used to be ctdb commit d21de127cceea7174b2e05701c8846c0b0c881c0)
2007-04-27 16:53:52 +02:00
Andrew Tridgell
eee3912c99 some debug code
(This used to be ctdb commit 957801ad6285c21fd11469a60dbdcc170e7009cb)
2007-04-27 16:42:43 +02:00
Ronnie Sahlberg
5b4ebe1345 make srvid 64 bits instead of 32 bits
(This used to be ctdb commit 723bcfbba1d5aa711496d37b9658190b78a2d66b)
2007-04-28 00:31:45 +10:00
Andrew Tridgell
3dc6331aee merged broadcast messages from ronnie
(This used to be ctdb commit bc20a7de280dbaa5e8ceb5493c51c059aa80d41c)
2007-04-27 15:26:13 +02:00
Ronnie Sahlberg
f616f2de10 add a special VNN that means "all" nodes so that a message can be
broadcasted to all daemons in the cluster

change the message dispatch routine for sending messages so that it 
allows several clients to use the same srvid
messages are then passed on to all clients that have that srvid

(This used to be ctdb commit 05d7ebb3556785f0f17a87d808f31ffe8dac288a)
2007-04-27 23:16:17 +10:00
Andrew Tridgell
22546add19 debug level controls
(This used to be ctdb commit 85f883c081dd1ab069420d2e7f4f2e9d708b3cde)
2007-04-27 15:14:36 +02:00
Ronnie Sahlberg
d4c54a93a0 add a new control : SETVNNMAP to set the generation id and also the vnn
map on a ctdbd daemon

(This used to be ctdb commit f55707885f7b233ad6ddfc952d08851577063200)
2007-04-27 22:08:12 +10:00
Ronnie Sahlberg
d9edf88ae5 add a control to read the vnnmap configuration from a node
add support in ctdb_control to fetch this information from a node

(This used to be ctdb commit 8d7f26c8d78d30c3ccb15a28ddea940d8666e052)
2007-04-27 20:56:10 +10:00
Ronnie Sahlberg
ec3856ead9 add a mapping table from a hash value to a lmaster vnn number
update ctdb_lmaster() return the lmaster based on this tables contents


initialize the vnn table based on number of nodes for now.
later when recovery is implemented the recovery process will populate 
this mapping table.

(This used to be ctdb commit 71e440f6c26ea074f9887237c962101c8cef8c80)
2007-04-27 18:43:52 +10:00
Andrew Tridgell
f0a582e454 got rid of the getdbpath call
(This used to be ctdb commit 736ce5c00a1d1b47abb44c4b262b14bfba5202b1)
2007-04-26 23:10:35 +02:00
Andrew Tridgell
afa0876335 added a ctdb_get_config call
added a ctdb ping control

(This used to be ctdb commit 7d17378b6e6076a922cffe98239e20dfbbae3bf7)
2007-04-26 19:27:07 +02:00
Andrew Tridgell
c23d1694db merge from peter
(This used to be ctdb commit ddf390da2bceb5b3f431433aec424d99d98c05f4)
2007-04-26 15:28:13 +02:00
Peter Somogyi
9d521cf16a merged tridge's branch
(This used to be ctdb commit 02ec7d6abb75a7c0a414efd4a50d44e6f1e5e407)
2007-04-26 15:00:24 +02:00
Andrew Tridgell
8ae14b4052 moved status to ctdb_control
(This used to be ctdb commit 9a543968ba0379fbf8e977e184f22f4349d6243f)
2007-04-26 14:51:41 +02:00
Andrew Tridgell
d955485e7b added a ctdb control message, and tool
(This used to be ctdb commit 0d7a71f35bb8ce95231f8ca1e8e3e4024fe657e5)
2007-04-26 14:27:49 +02:00
Andrew Tridgell
c1a4b3c687 merge from ronnie
(This used to be ctdb commit 37ef65737571a4290a150c28cf2b0a6b221253fd)
2007-04-26 11:13:49 +02:00
Ronnie Sahlberg
dabf61075f add pdu's that the client can use to query the ctdb daemon of the path
to the database it created (so the client can open and access the same 
file)

(This used to be ctdb commit c2eda19499b3263b2248c41bd531fb73c7b42212)
2007-04-24 00:06:48 +10:00
Ronnie Sahlberg
bd62c78154 split the 32bit idr field into two.
store the idr as the high 16 bits and use a rotating counter for the low 
16 bits.

(This used to be ctdb commit 7c763b7b5e6ca54a6df4586893ddaf1b508b4c22)
2007-04-23 18:19:50 +10:00
Andrew Tridgell
f651581460 added max_redirect_count status field
(This used to be ctdb commit ecea04741fe552aa409ab165d7c69ead9649986c)
2007-04-22 18:57:22 +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
2a08818e24 added a useful tool for dumping a ctdb
(This used to be ctdb commit 671ed94011e21396571a3f4a5191b9a83911c952)
2007-04-22 09:24:27 +02:00
Peter Somogyi
981a5f9d30 removing my dirt from tridge's code
(this change wasn't necessary)

(This used to be ctdb commit 217d996abdafe91c2f51d9d486d95a6607b56285)
2007-04-20 16:22:57 +02:00
Peter Somogyi
e5f2e5e5eb - ctdb/ib minor bugfixes (error case)
- make ctdb capable of alternative connection (like ib) again, solved the fork problem
- do_debug memory overwrite bugfix (occured using ibwrapper_test with wrong address given)

(This used to be ctdb commit da0b84cda26d544f63841dfd770ed7ebad401944)
2007-04-20 14:26:19 +02:00
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
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
634aa50d90 don't need these structures any more
(This used to be ctdb commit 506117dc24ec647c629c92a3996455cd8d9c8ec6)
2007-04-19 12:34:24 +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
36816ee12a 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)
2007-04-19 09:14:25 +10:00
Volker Lendecke
9135024fc7 Add --dbdir to ctdbd. Necessary for shared operation between ctdbd and smbd.
(This used to be ctdb commit bce40105e2ccbca5e364793bbf1a6357e6dd69b2)
2007-04-18 16:36:22 +02:00
Andrew Tridgell
ef505399e6 merged cleanup from ronnie
(This used to be ctdb commit 26037a7b3557faa1c10944f654b1465877c6b840)
2007-04-18 18:43:34 +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
Ronnie sahlberg
8dc428d63d we dont need the structure ctdb_reply_shutdown since we dont implement that pdu any more
(This used to be ctdb commit 5bac32b3daf3c61214269cd09cfc1b6c3f8c3d6e)
2007-04-18 17:04:26 +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
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
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
3057f683f3 Add timestamps to debug output.
(This used to be ctdb commit 197a02384bd2ca42dfff4c0357175424d2321e9c)
2007-04-17 17:59:39 +02:00
Andrew Tridgell
1e2d91c761 moved cmdline.c to common code
(This used to be ctdb commit 32b31a6b91a19fc0c5225cb88c35cc1d14b4a6df)
2007-04-17 22:16:50 +10: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
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
e5fff3d611 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)
2007-04-17 12:22:17 +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
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
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
f62bb4e8fc merge CTDB_SRVID_ALL patch from Samba4
(This used to be ctdb commit 43cd05ab58e940a1ef0352aabe0b63075264a7a0)
2007-04-16 10:31:39 +10:00