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

230 Commits

Author SHA1 Message Date
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
be17d4d181 ctdb_control should use the provided timeout and not hardcode to 1.0
seconds

(This used to be ctdb commit 03acb2f450578f6195ab2d0a598f6720e33e7cfb)
2007-05-04 08:32:02 +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
Andrew Tridgell
de0f848556 don't zero beyond packet header unnecessarily
(This used to be ctdb commit 4cf88ca2ce81db8fe10b0dfedb81d99a2bd93328)
2007-05-03 13:44:27 +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
Andrew Tridgell
622dbb6337 merge from ronnie
(This used to be ctdb commit daba707370b28e200d9e55eb81fc819b62f8fbdd)
2007-05-03 07:19:29 +10:00
Andrew Tridgell
f51a988b74 fixed a memory leak in the ctdb_control code
(This used to be ctdb commit 70aa77a66bb5f16c93ecb122b92a6e63f6343ab1)
2007-05-03 05:51:46 +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
a1cac30684 discard REQ/REPLY DMASTER when generation id is wrong or when in
recovery mode

(This used to be ctdb commit bfd6d430f22e38cff1d64510dc447cfbe1dab35f)
2007-05-02 13:31:42 +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
88e3ca3b2e fix a bug in pushdb control.
we should only write the pushed record if RSN of the new one if higher 
than the rsn of the existing one    not the other way around

(This used to be ctdb commit f535008c3755cf84acff7bc73ea05c0901e940ef)
2007-05-02 10:25:14 +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
2dc24c7d56 added a hopcount in ctdb_call
(This used to be ctdb commit 36d838801a2a2008c50322cdbfff65a308b1cd1a)
2007-05-01 13:25:02 +10:00
Andrew Tridgell
5b8c4bba5a auto-determine listen address by attempting to bind to each address in the cluster in turn
(This used to be ctdb commit 2fab9f96df2e5b5c51c860fd65caf0e926a63e34)
2007-05-01 06:34:55 +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
4832d8f834 don't use stderr here - rely on logging
(This used to be ctdb commit a2a3b254b22dbaafc8c4934d99cc67d6ae4adbd1)
2007-04-30 11:10:21 +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
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