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

428 Commits

Author SHA1 Message Date
Ronnie Sahlberg
6681da31df add an initial implementation of a service_id structure and three
controls to  register/unregister/check a server id.

a server id consists of TYPE:VNN:ID    where type is specific to the 
application.  VNN is the node where the serverid was registered and ID 
might be a node unique identifier such as a pid or similar.


Clients can register a server id for themself at the local ctdb daemon.
When a client dissappears   or when the domain socket connection for the 
client drops  then any and all server ids registered across that domain 
socket will also be automatically removed from the store.

clients can register as many server_ids as they want at the same time    
but each TYPE:VNN:ID must be globally unique.

Clients have the option of explicitely unregister a server id by using 
the UNREGISTER control.


Registration and unregistration can only be done by clients to the local 
daemon. clients can not register their server id to a remote node.


clients can check if a server id does exist on any ctdb node in the 
network by using the check control

(This used to be ctdb commit d44798feec26147c5cc05922cb2186f0ef0307be)
2007-08-24 15:53:41 +10:00
Andrew Tridgell
df9ec77b6b merge from volker
(This used to be ctdb commit a5587b3c065f7115ad5e55429c2c9d9923d3b4dc)
2007-08-22 17:18:55 +10:00
Ronnie Sahlberg
6fc0653b97 zero out the sa struct to supress a valgrind error
(This used to be ctdb commit b17ff60ad4c5fac76d3f77dacb10c30ae564bf09)
2007-08-15 12:34:41 +10:00
Ronnie Sahlberg
e0957ba4a4 add a function to return the first entry that is stored in a tree where
the key is an array of uint32_t

(This used to be ctdb commit 99553397aade4f1c4d17ef14dad406934958c80a)
2007-08-15 10:57:21 +10:00
Ronnie Sahlberg
adb49f02f0 change the mem hierarchy for trees. let the node be owned by the data
we store in the tree and use a node destructor so that when the data is 
talloc_free()d we also remove the node from the tree.

(This used to be ctdb commit b8dabd1811ebd85ee031563e95085f720a2fa04d)
2007-08-09 14:08:59 +10:00
Ronnie Sahlberg
18deb7e015 remove an unused function
(This used to be ctdb commit 38a26d1f3709fbce551bc3a7af8bacd0ff465bca)
2007-08-09 07:59:50 +10:00
Ronnie Sahlberg
203306400e add helpers to traverse a tree where the key is an array of uint32
(This used to be ctdb commit d328c66827cafff6356e96df2a782930274fe139)
2007-08-08 13:50:18 +10:00
Ronnie Sahlberg
9525b010aa add helpers to add/lookup/delete nodes in a tree where the key is an
array of uint32

(This used to be ctdb commit b7e0996e7735c8629d07453b9d335990c2dbc3db)
2007-08-08 12:30:12 +10:00
Ronnie Sahlberg
c1bfda5772 add a tree insert function that takes a callback fucntion to populate
the data of the tree.
this callback makes it more convenient to manage cases where one might 
want to insert multiple entries into the tree with the same key

rename the tree->tree pointer to tree->root  since this is supposed to 
point to the root of the tree

add a small test utility

(This used to be ctdb commit f6313bed9c53e0d1c36c9e08ac707e88e2a4fcd5)
2007-08-08 11:21:18 +10:00
Ronnie Sahlberg
49f0317b21 when inserting data in the tree, if there was already a node with the
same key then replace the data in the node with the new data and return 
the pointer to the previous data held in the node.

this allows a caller to avoid having to first check if a node already 
exists before inserting a possibly duplicate/colliding entry and lets 
the caller do whatever it needs to do after the fact.

(This used to be ctdb commit 6634cabb910c26400780d51727ff2d1ba5e16e36)
2007-08-08 08:20:46 +10:00
Ronnie Sahlberg
24d1ee09ec dont wait indefinitely for the initial getvnn to complete
(This used to be ctdb commit ef38725ad8c5f1792feacb14b8888f246187da15)
2007-08-08 07:35:53 +10:00
Ronnie Sahlberg
d69055b789 change error output in ctdb and in ctdb_cmdline_client to print to
stderr instead of stdout

(This used to be ctdb commit 6e6e165c2d8f0963ce37567c23aaa012fc3e89d9)
2007-08-07 12:51:25 +10:00
Ronnie Sahlberg
c76f323f73 fix the remaining bugs with tree delete that testing found.
the binary tree should work reasonably well now for delete.
insert always worked fine.

(This used to be ctdb commit 452cda26b206549504480b77483308b44cfa8b01)
2007-07-30 09:09:34 +10:00
Ronnie Sahlberg
8df376b3f0 remove dead code
(This used to be ctdb commit 97ffcda5e56f04aed2f4f8b889b4eb6311f69c4d)
2007-07-26 07:22:36 +10:00
Ronnie Sahlberg
84851b674c fix some remaining bugs with deleting nodes
(This used to be ctdb commit 8aec0e0bef794afce1d2abf762bfadee4ab7e619)
2007-07-26 07:21:32 +10:00
Ronnie Sahlberg
8e0a12463b there were situations where we were not guaranteed that a sibling had 2
child nodes which would cause a segv when trying to dereferencing those 
two child nodes in order to read their color

(This used to be ctdb commit 56f5fb8f8f3e667f5bc13f09fb5de01f5f2e0fae)
2007-07-25 17:53:55 +10:00
Ronnie Sahlberg
904e5ba55e if sibling is NULL it is a leaf node and thus black.
(This used to be ctdb commit 400488472ba64514fa6534d5de90edba6c5e27c6)
2007-07-25 17:22:04 +10:00
Ronnie Sahlberg
13e56a81a9 initial version of talloc based red-black trees
very initial version

(This used to be ctdb commit 121f5c9dfc8e441313e42d94bed9c9f13ec91398)
2007-07-24 18:51:13 +10:00
Ronnie Sahlberg
217142d1e9 add some support for controlling Linux or AIX in the makefile
this should really be done by configure

(This used to be ctdb commit 5a855599288995659e81f1bdbed157bdb207f94a)
2007-07-14 10:58:51 +10:00
Ronnie Sahlberg
a8211f9d1f add an initial system_aix.c to manage raw sockets under aix
(This used to be ctdb commit 277527befedd6f5dfde1c51698245197afd83d99)
2007-07-14 10:27:34 +10:00
Ronnie Sahlberg
6b143c4c5e update the comment at the top of file to reflect the purpose of the file
(This used to be ctdb commit 4d7670102f44ff0f99dafeb050843be38cb258b0)
2007-07-13 17:10:09 +10:00
Ronnie Sahlberg
f09566a81a add a private_data field to the killtcp structure and let the system
specific routines populate it as it see fit when creating a 
capture socket.
pass this structure to read_tcp and close capture socket as parameter

(This used to be ctdb commit 79bbfcfb2223889126fe307d5bbfd24917da07ee)
2007-07-13 17:07:10 +10:00
Andrew Tridgell
1e14ecd176 - merge from ronnie
- cleaner handling of system capture socket

(This used to be ctdb commit d194a41a71b8466d0726dcbae3970a86386fcb3c)
2007-07-13 11:31:18 +10:00
Andrew Tridgell
d2a5af7eb8 fully save/restore scheduler parameters
(This used to be ctdb commit 59408eabe7515d49a6eef3b6fb2590a1cd1df956)
2007-07-13 09:35:46 +10:00
Ronnie Sahlberg
850e634166 netinet/if_ether.h is more portable than net/ethernet.h
(This used to be ctdb commit ee84ea17529a27e22c1a0503d07aaeec1ef731e2)
2007-07-12 11:43:30 +10:00
Ronnie Sahlberg
9cde594006 the posix.4 name for the priority field is sched_priority
not __sched_priority

(This used to be ctdb commit c08c5a36b3f1dd2cb72278058cb5664816e1d339)
2007-07-12 11:31:20 +10:00
Ronnie Sahlberg
a650497680 as an optimization for when we want to send multiple tickles at a time
let the caller create the sending socket and use a single socket instead 
of one new one for each tickle.
pass a sending socket to ctdb_sys_send_tcp()

ctdb_sys_kill_tcp is not longer used so remove it

set the socketflags for close on exec and nonblocking in the helper that 
creates the sockets instead of in the caller

add a helper to create a sending socket to send tickles from

(This used to be ctdb commit 469f3fb238a0674a2b48fdf1a7e657e32428178a)
2007-07-12 09:22:06 +10:00
Ronnie Sahlberg
823b7d4a5f rename killtcp->fd to killtcp->capture_fd
we might want to have two sockets attached to the killtcp structure
one for capturing and a second one for sending  so we dont have to 
create a new socket for each tickle we want to send

(This used to be ctdb commit b3e82ec38047bbec1edfd88ade264077d4cbd2ee)
2007-07-12 08:52:24 +10:00
Ronnie Sahlberg
e4db03f7e6 add a ctdb_ prefix to two public functions
(This used to be ctdb commit 32adee5426aa75ddcd4d648ef326ed03d5ff5c46)
2007-07-11 18:13:03 +10:00
Ronnie Sahlberg
aa080f66d9 first cut at a better and more scalable socketkiller
that can kill multiple connections asynchronously using one listening 
socket

(This used to be ctdb commit 22bb44f3d745aa354becd75d30774992f6c40b3a)
2007-07-11 17:43:51 +10:00
Andrew Tridgell
32de198fd3 update lib/replace from samba4
(This used to be ctdb commit f0555484105668c01c21f56322992e752e831109)
2007-07-10 15:29:31 +10:00
Andrew Tridgell
bdf01ed7c0 - neaten up the command line for killtcp
- split out the event script code into a separate module
- get rid of the separate takeover directory

(This used to be ctdb commit 8ea2c923a3e2464200ff79bf2c3f1f89e6a93ad4)
2007-07-04 16:51:13 +10:00
Andrew Tridgell
14c788f3cb move more util code to lib/util
(This used to be ctdb commit de5ab0584c978a6be4afeacd80c84015b206a3c6)
2007-06-07 22:30:29 +10:00
Andrew Tridgell
ae3d54094b start splitting the code into separate client and server pieces
(This used to be ctdb commit 603cd77988c181525946cd5eb0f4d0d646b58059)
2007-06-07 22:06:19 +10:00
Andrew Tridgell
3d75c9a51d later times are a lower priority, not a higher priority
(This used to be ctdb commit e96424e7d366df29767c4eeaccdcc0cc975cb8ae)
2007-06-07 19:21:55 +10:00
Andrew Tridgell
dbb803e6af choose the most connected node first
(This used to be ctdb commit c7c17a79fa4f28509e34b6f635fa62517dc458c2)
2007-06-07 19:17:27 +10:00
Andrew Tridgell
df6439d796 formatting fixes
(This used to be ctdb commit ed63a2057698aed3931762605b2ea2368681af2b)
2007-06-07 18:39:37 +10:00
Andrew Tridgell
d774192737 use a priority time for the election data, not just the vnn
(This used to be ctdb commit a691f9c5cd77194005f0d98483da94b07a48d57d)
2007-06-07 18:37:27 +10:00
Andrew Tridgell
c42ddcda23 validate vnn on node flags change
(This used to be ctdb commit 5628ebbcc2aa61b63c761783c70fe4d8a0070607)
2007-06-07 18:13:14 +10:00
Andrew Tridgell
96861466b7 there are now far too many controls for the controls statistics fields to be useful
(This used to be ctdb commit f5e188fc7e13b55b6b4081dcc74ea9614a76f9bb)
2007-06-07 18:07:38 +10:00
Andrew Tridgell
3e4d7bef23 get all the tunables at once in recovery daemon
(This used to be ctdb commit 8e60be6c22aab145e68b16ede5f32f4430c2af93)
2007-06-07 18:05:25 +10:00
Andrew Tridgell
cb4c33cc68 handle CTDB_CURRENT_NODE in ban commands
(This used to be ctdb commit fefb53f1d22c5458a1e107f8352818aee87983de)
2007-06-07 16:48:31 +10:00
Andrew Tridgell
23bf62fe30 added admin commands to ban/unban nodes
(This used to be ctdb commit 4dad04172e7e4955b5bf6444a85b19901c9683ad)
2007-06-07 16:34:33 +10:00
Andrew Tridgell
2ed57a9ae1 implement a scheme where nodes are banned if they continuously caused the cluster
to start a recovery session. The node is banned from the cluster for the RecoveryBanPeriod (default of 5 minutes)

(This used to be ctdb commit 4ad43dd07f526b6002477177fbf55483246c2c0c)
2007-06-07 15:18:55 +10:00
Andrew Tridgell
9754d16d48 merged admin enable/disable change from ronnie
(This used to be ctdb commit df17b69dfd83a98f9c711994c7dd51ad2cc0ab8a)
2007-06-07 11:15:22 +10:00
Ronnie Sahlberg
9ff733c784 add a control to permanently enable/disable a node
(This used to be ctdb commit d66fdba16ca22f62ddac6882a17614879b08a798)
2007-06-07 09:16:17 +10:00
Andrew Tridgell
8fbca613d4 get parents idea of recmode and recmaster when deciding if we should do a takeover run
(This used to be ctdb commit 0e8124acd2f1a9b34292c1ee13c7e4cd6fe49876)
2007-06-06 21:56:54 +10:00
Andrew Tridgell
4a7f116746 update flags in parent daemon too
(This used to be ctdb commit 8995246d95e670753ab8c61d724d284cac2b414d)
2007-06-06 21:34:36 +10:00
Andrew Tridgell
ae56096b0b ensure all nodes display disabled nodes correctly
(This used to be ctdb commit 959f82cfe926994658f5826007caccb0409003e1)
2007-06-06 21:27:09 +10:00
Andrew Tridgell
81fad8636f added timeouts in all event scripts
(This used to be ctdb commit d986c91a607ed7c7d4869ea786b5cdf80e7862f1)
2007-06-06 13:45:12 +10:00