2 ctdb database library: old client interface
4 Copyright (C) Andrew Tridgell 2006
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #ifndef _CTDB_CLIENT_H
21 #define _CTDB_CLIENT_H
23 #include "common/srvid.h"
24 #include "ctdb_protocol.h"
33 struct ctdb_client_control_state
{
34 struct ctdb_context
*ctdb
;
38 enum control_state state
;
40 struct ctdb_req_control_old
*c
;
42 /* if we have a callback registered for the completion (or failure) of
44 if a callback is used, it MUST talloc_free the cb_data passed to it
47 void (*fn
)(struct ctdb_client_control_state
*);
52 struct tevent_context
;
53 struct ctdb_db_context
;
56 allocate a packet for use in client<->daemon communication
58 struct ctdb_req_header
*_ctdbd_allocate_pkt(struct ctdb_context
*ctdb
,
60 enum ctdb_operation operation
,
61 size_t length
, size_t slength
,
64 #define ctdbd_allocate_pkt(ctdb, mem_ctx, operation, length, type) \
65 (type *)_ctdbd_allocate_pkt(ctdb, mem_ctx, operation, length, \
68 int ctdb_call_local(struct ctdb_db_context
*ctdb_db
, struct ctdb_call
*call
,
69 struct ctdb_ltdb_header
*header
, TALLOC_CTX
*mem_ctx
,
70 TDB_DATA
*data
, bool updatetdb
);
72 void ctdb_request_message(struct ctdb_context
*ctdb
,
73 struct ctdb_req_header
*hdr
);
75 void ctdb_client_read_cb(uint8_t *data
, size_t cnt
, void *args
);
77 int ctdb_socket_connect(struct ctdb_context
*ctdb
);
80 make a ctdb call. The associated ctdb call function will be called on the DMASTER
83 struct ctdb_client_call_state
*ctdb_call_send(struct ctdb_db_context
*ctdb_db
,
84 struct ctdb_call
*call
);
85 int ctdb_call_recv(struct ctdb_client_call_state
*state
,
86 struct ctdb_call
*call
);
87 int ctdb_call(struct ctdb_db_context
*ctdb_db
, struct ctdb_call
*call
);
89 /* setup a handler for ctdb messages */
90 typedef void (*ctdb_msg_fn_t
)(struct ctdb_context
*, uint64_t srvid
,
91 TDB_DATA data
, void *);
93 int ctdb_client_set_message_handler(struct ctdb_context
*ctdb
, uint64_t srvid
,
94 srvid_handler_fn handler
,
96 int ctdb_client_remove_message_handler(struct ctdb_context
*ctdb
,
97 uint64_t srvid
, void *private_data
);
98 int ctdb_client_check_message_handlers(struct ctdb_context
*ctdb
,
99 uint64_t *ids
, uint32_t num
,
102 /* send a ctdb message */
103 int ctdb_client_send_message(struct ctdb_context
*ctdb
, uint32_t pnn
,
104 uint64_t srvid
, TDB_DATA data
);
107 Fetch a ctdb record from a remote node. Underneath this will force the
108 dmaster for the record to be moved to the local node.
110 struct ctdb_record_handle
*ctdb_fetch_lock(struct ctdb_db_context
*ctdb_db
,
112 TDB_DATA key
, TDB_DATA
*data
);
114 struct ctdb_record_handle
*ctdb_fetch_readonly_lock(
115 struct ctdb_db_context
*ctdb_db
,
116 TALLOC_CTX
*mem_ctx
, TDB_DATA key
,
117 TDB_DATA
*data
, int read_only
);
119 int ctdb_record_store(struct ctdb_record_handle
*h
, TDB_DATA data
);
121 int ctdb_fetch(struct ctdb_db_context
*ctdb_db
, TALLOC_CTX
*mem_ctx
,
122 TDB_DATA key
, TDB_DATA
*data
);
124 struct ctdb_client_control_state
*ctdb_control_send(struct ctdb_context
*ctdb
,
131 struct timeval
*timeout
,
133 int ctdb_control_recv(struct ctdb_context
*ctdb
,
134 struct ctdb_client_control_state
*state
,
135 TALLOC_CTX
*mem_ctx
, TDB_DATA
*outdata
,
136 int32_t *status
, char **errormsg
);
137 int ctdb_control(struct ctdb_context
*ctdb
, uint32_t destnode
, uint64_t srvid
,
138 uint32_t opcode
, uint32_t flags
, TDB_DATA data
,
139 TALLOC_CTX
*mem_ctx
, TDB_DATA
*outdata
, int32_t *status
,
140 struct timeval
*timeout
, char **errormsg
);
142 int ctdb_ctrl_process_exists(struct ctdb_context
*ctdb
, uint32_t destnode
,
145 int ctdb_ctrl_statistics(struct ctdb_context
*ctdb
, uint32_t destnode
,
146 struct ctdb_statistics
*status
);
147 int ctdb_ctrl_dbstatistics(struct ctdb_context
*ctdb
, uint32_t destnode
,
148 uint32_t dbid
, TALLOC_CTX
*mem_ctx
,
149 struct ctdb_db_statistics_old
**dbstat
);
151 int ctdb_ctrl_shutdown(struct ctdb_context
*ctdb
, struct timeval timeout
,
154 int ctdb_ctrl_getvnnmap(struct ctdb_context
*ctdb
, struct timeval timeout
,
155 uint32_t destnode
, TALLOC_CTX
*mem_ctx
,
156 struct ctdb_vnn_map
**vnnmap
);
157 int ctdb_ctrl_setvnnmap(struct ctdb_context
*ctdb
, struct timeval timeout
,
158 uint32_t destnode
, TALLOC_CTX
*mem_ctx
,
159 struct ctdb_vnn_map
*vnnmap
);
162 get the recovery mode of a remote node
164 struct ctdb_client_control_state
*ctdb_ctrl_getrecmode_send(
165 struct ctdb_context
*ctdb
,
167 struct timeval timeout
,
169 int ctdb_ctrl_getrecmode_recv(struct ctdb_context
*ctdb
, TALLOC_CTX
*mem_ctx
,
170 struct ctdb_client_control_state
*state
,
172 int ctdb_ctrl_getrecmode(struct ctdb_context
*ctdb
, TALLOC_CTX
*mem_ctx
,
173 struct timeval timeout
, uint32_t destnode
,
177 set the recovery mode of a remote node
179 int ctdb_ctrl_setrecmode(struct ctdb_context
*ctdb
, struct timeval timeout
,
180 uint32_t destnode
, uint32_t recmode
);
183 get the recovery master of a remote node
185 struct ctdb_client_control_state
*ctdb_ctrl_getrecmaster_send(
186 struct ctdb_context
*ctdb
,
188 struct timeval timeout
,
190 int ctdb_ctrl_getrecmaster_recv(struct ctdb_context
*ctdb
,
192 struct ctdb_client_control_state
*state
,
193 uint32_t *recmaster
);
194 int ctdb_ctrl_getrecmaster(struct ctdb_context
*ctdb
, TALLOC_CTX
*mem_ctx
,
195 struct timeval timeout
, uint32_t destnode
,
196 uint32_t *recmaster
);
199 set the recovery master of a remote node
201 int ctdb_ctrl_setrecmaster(struct ctdb_context
*ctdb
, struct timeval timeout
,
202 uint32_t destnode
, uint32_t recmaster
);
204 int ctdb_ctrl_getdbmap(struct ctdb_context
*ctdb
, struct timeval timeout
,
205 uint32_t destnode
, TALLOC_CTX
*mem_ctx
,
206 struct ctdb_dbid_map_old
**dbmap
);
208 int ctdb_ctrl_getnodemap(struct ctdb_context
*ctdb
, struct timeval timeout
,
209 uint32_t destnode
, TALLOC_CTX
*mem_ctx
,
210 struct ctdb_node_map_old
**nodemap
);
212 int ctdb_ctrl_getnodesfile(struct ctdb_context
*ctdb
, struct timeval timeout
,
213 uint32_t destnode
, TALLOC_CTX
*mem_ctx
,
214 struct ctdb_node_map_old
**nodemap
);
216 int ctdb_ctrl_reload_nodes_file(struct ctdb_context
*ctdb
,
217 struct timeval timeout
, uint32_t destnode
);
219 struct ctdb_client_control_state
*ctdb_ctrl_pulldb_send(
220 struct ctdb_context
*ctdb
,
221 uint32_t destnode
, uint32_t dbid
,
222 uint32_t lmaster
, TALLOC_CTX
*mem_ctx
,
223 struct timeval timeout
);
224 int ctdb_ctrl_pulldb_recv(struct ctdb_context
*ctdb
, TALLOC_CTX
*mem_ctx
,
225 struct ctdb_client_control_state
*state
,
227 int ctdb_ctrl_pulldb(struct ctdb_context
*ctdb
, uint32_t destnode
,
228 uint32_t dbid
, uint32_t lmaster
, TALLOC_CTX
*mem_ctx
,
229 struct timeval timeout
, TDB_DATA
*outdata
);
232 change dmaster for all keys in the database to the new value
234 int ctdb_ctrl_setdmaster(struct ctdb_context
*ctdb
, struct timeval timeout
,
235 uint32_t destnode
, TALLOC_CTX
*mem_ctx
,
236 uint32_t dbid
, uint32_t dmaster
);
238 int ctdb_ctrl_ping(struct ctdb_context
*ctdb
, uint32_t destnode
);
240 int ctdb_ctrl_get_runstate(struct ctdb_context
*ctdb
, struct timeval timeout
,
241 uint32_t destnode
, uint32_t *runstate
);
243 int ctdb_ctrl_getdbpath(struct ctdb_context
*ctdb
, struct timeval timeout
,
244 uint32_t destnode
, uint32_t dbid
,
245 TALLOC_CTX
*mem_ctx
, const char **path
);
246 int ctdb_ctrl_getdbname(struct ctdb_context
*ctdb
, struct timeval timeout
,
247 uint32_t destnode
, uint32_t dbid
,
248 TALLOC_CTX
*mem_ctx
, const char **name
);
249 int ctdb_ctrl_getdbhealth(struct ctdb_context
*ctdb
, struct timeval timeout
,
250 uint32_t destnode
, uint32_t dbid
,
251 TALLOC_CTX
*mem_ctx
, const char **reason
);
252 int ctdb_ctrl_getdbseqnum(struct ctdb_context
*ctdb
, struct timeval timeout
,
253 uint32_t destnode
, uint32_t dbid
, uint64_t *seqnum
);
255 int ctdb_ctrl_createdb(struct ctdb_context
*ctdb
, struct timeval timeout
,
256 uint32_t destnode
, TALLOC_CTX
*mem_ctx
,
257 const char *name
, bool persistent
);
259 int ctdb_ctrl_get_debuglevel(struct ctdb_context
*ctdb
, uint32_t destnode
,
261 int ctdb_ctrl_set_debuglevel(struct ctdb_context
*ctdb
, uint32_t destnode
,
264 uint32_t *ctdb_get_connected_nodes(struct ctdb_context
*ctdb
,
265 struct timeval timeout
,
266 TALLOC_CTX
*mem_ctx
, uint32_t *num_nodes
);
268 int ctdb_statistics_reset(struct ctdb_context
*ctdb
, uint32_t destnode
);
271 attach to a ctdb database
273 struct ctdb_db_context
*ctdb_attach(struct ctdb_context
*ctdb
,
274 struct timeval timeout
,
279 int ctdb_detach(struct ctdb_context
*ctdb
, uint32_t db_id
);
281 /* a ctdb call function */
282 typedef int (*ctdb_fn_t
)(struct ctdb_call_info
*);
285 setup a ctdb call function
287 int ctdb_set_call(struct ctdb_db_context
*ctdb_db
, ctdb_fn_t fn
, uint32_t id
);
290 typedef int (*ctdb_traverse_func
)(TDB_DATA
, TDB_DATA
, void *);
292 int ctdb_traverse(struct ctdb_db_context
*ctdb_db
, ctdb_traverse_func fn
,
295 struct ctdb_dump_db_context
{
296 struct ctdb_context
*ctdb
;
298 bool printemptyrecords
;
302 bool printrecordflags
;
305 int ctdb_dumpdb_record(TDB_DATA key
, TDB_DATA data
, void *p
);
306 int ctdb_dump_db(struct ctdb_db_context
*ctdb_db
,
307 struct ctdb_dump_db_context
*ctx
);
310 get the pid of a ctdb daemon
312 int ctdb_ctrl_getpid(struct ctdb_context
*ctdb
, struct timeval timeout
,
313 uint32_t destnode
, uint32_t *pid
);
315 struct ctdb_client_control_state
*ctdb_ctrl_freeze_send(
316 struct ctdb_context
*ctdb
,
318 struct timeval timeout
,
319 uint32_t destnode
, uint32_t priority
);
320 int ctdb_ctrl_freeze_recv(struct ctdb_context
*ctdb
, TALLOC_CTX
*mem_ctx
,
321 struct ctdb_client_control_state
*state
);
323 int ctdb_ctrl_freeze_priority(struct ctdb_context
*ctdb
, struct timeval timeout
,
324 uint32_t destnode
, uint32_t priority
);
325 int ctdb_ctrl_freeze(struct ctdb_context
*ctdb
, struct timeval timeout
,
328 int ctdb_ctrl_thaw_priority(struct ctdb_context
*ctdb
, struct timeval timeout
,
329 uint32_t destnode
, uint32_t priority
);
330 int ctdb_ctrl_thaw(struct ctdb_context
*ctdb
, struct timeval timeout
,
333 int ctdb_ctrl_getpnn(struct ctdb_context
*ctdb
, struct timeval timeout
,
337 get the monitoring mode of a remote node
339 int ctdb_ctrl_getmonmode(struct ctdb_context
*ctdb
, struct timeval timeout
,
340 uint32_t destnode
, uint32_t *monmode
);
343 set the monitoring mode of a remote node to active
345 int ctdb_ctrl_enable_monmode(struct ctdb_context
*ctdb
,
346 struct timeval timeout
, uint32_t destnode
);
349 set the monitoring mode of a remote node to disabled
351 int ctdb_ctrl_disable_monmode(struct ctdb_context
*ctdb
,
352 struct timeval timeout
, uint32_t destnode
);
354 int ctdb_ctrl_takeover_ip(struct ctdb_context
*ctdb
, struct timeval timeout
,
355 uint32_t destnode
, struct ctdb_public_ip
*ip
);
356 int ctdb_ctrl_release_ip(struct ctdb_context
*ctdb
, struct timeval timeout
,
357 uint32_t destnode
, struct ctdb_public_ip
*ip
);
359 int ctdb_ctrl_get_tunable(struct ctdb_context
*ctdb
,
360 struct timeval timeout
, uint32_t destnode
,
361 const char *name
, uint32_t *value
);
362 int ctdb_ctrl_set_tunable(struct ctdb_context
*ctdb
,
363 struct timeval timeout
, uint32_t destnode
,
364 const char *name
, uint32_t value
);
365 int ctdb_ctrl_list_tunables(struct ctdb_context
*ctdb
,
366 struct timeval timeout
, uint32_t destnode
,
368 const char ***list
, uint32_t *count
);
370 int ctdb_ctrl_get_public_ips_flags(struct ctdb_context
*ctdb
,
371 struct timeval timeout
, uint32_t destnode
,
372 TALLOC_CTX
*mem_ctx
, uint32_t flags
,
373 struct ctdb_public_ip_list_old
**ips
);
374 int ctdb_ctrl_get_public_ips(struct ctdb_context
*ctdb
,
375 struct timeval timeout
, uint32_t destnode
,
377 struct ctdb_public_ip_list_old
**ips
);
378 int ctdb_ctrl_get_public_ip_info(struct ctdb_context
*ctdb
,
379 struct timeval timeout
, uint32_t destnode
,
381 const ctdb_sock_addr
*addr
,
382 struct ctdb_public_ip_info_old
**info
);
384 int ctdb_ctrl_get_ifaces(struct ctdb_context
*ctdb
,
385 struct timeval timeout
, uint32_t destnode
,
387 struct ctdb_iface_list_old
**ifaces
);
388 int ctdb_ctrl_set_iface_link(struct ctdb_context
*ctdb
,
389 struct timeval timeout
, uint32_t destnode
,
391 const struct ctdb_iface
*info
);
393 int ctdb_ctrl_modflags(struct ctdb_context
*ctdb
,
394 struct timeval timeout
,
396 uint32_t set
, uint32_t clear
);
398 int ctdb_ctrl_get_all_tunables(struct ctdb_context
*ctdb
,
399 struct timeval timeout
, uint32_t destnode
,
400 struct ctdb_tunable_list
*tunables
);
402 int ctdb_ctrl_add_public_ip(struct ctdb_context
*ctdb
,
403 struct timeval timeout
, uint32_t destnode
,
404 struct ctdb_addr_info_old
*pub
);
405 int ctdb_ctrl_del_public_ip(struct ctdb_context
*ctdb
,
406 struct timeval timeout
, uint32_t destnode
,
407 struct ctdb_addr_info_old
*pub
);
409 int ctdb_ctrl_killtcp(struct ctdb_context
*ctdb
,
410 struct timeval timeout
, uint32_t destnode
,
411 struct ctdb_connection
*killtcp
);
413 int ctdb_ctrl_gratious_arp(struct ctdb_context
*ctdb
,
414 struct timeval timeout
, uint32_t destnode
,
415 ctdb_sock_addr
*addr
, const char *ifname
);
417 int ctdb_ctrl_get_tcp_tickles(struct ctdb_context
*ctdb
,
418 struct timeval timeout
, uint32_t destnode
,
419 TALLOC_CTX
*mem_ctx
, ctdb_sock_addr
*addr
,
420 struct ctdb_tickle_list_old
**list
);
422 int ctdb_ctrl_register_server_id(struct ctdb_context
*ctdb
,
423 struct timeval timeout
,
424 struct ctdb_client_id
*id
);
425 int ctdb_ctrl_unregister_server_id(struct ctdb_context
*ctdb
,
426 struct timeval timeout
,
427 struct ctdb_client_id
*id
);
428 int ctdb_ctrl_check_server_id(struct ctdb_context
*ctdb
,
429 struct timeval timeout
, uint32_t destnode
,
430 struct ctdb_client_id
*id
, uint32_t *status
);
431 int ctdb_ctrl_get_server_id_list(struct ctdb_context
*ctdb
,
433 struct timeval timeout
, uint32_t destnode
,
434 struct ctdb_client_id_list_old
**svid_list
);
437 initialise ctdb subsystem
439 struct ctdb_context
*ctdb_init(struct tevent_context
*ev
);
444 void ctdb_set_flags(struct ctdb_context
*ctdb
, unsigned flags
);
446 int ctdb_set_socketname(struct ctdb_context
*ctdb
, const char *socketname
);
447 const char *ctdb_get_socketname(struct ctdb_context
*ctdb
);
449 /* return pnn of this node */
450 uint32_t ctdb_get_pnn(struct ctdb_context
*ctdb
);
453 get the uptime of a remote node
455 struct ctdb_client_control_state
*ctdb_ctrl_uptime_send(
456 struct ctdb_context
*ctdb
,
458 struct timeval timeout
,
460 int ctdb_ctrl_uptime_recv(struct ctdb_context
*ctdb
, TALLOC_CTX
*mem_ctx
,
461 struct ctdb_client_control_state
*state
,
462 struct ctdb_uptime
**uptime
);
463 int ctdb_ctrl_uptime(struct ctdb_context
*ctdb
, TALLOC_CTX
*mem_ctx
,
464 struct timeval timeout
, uint32_t destnode
,
465 struct ctdb_uptime
**uptime
);
467 int ctdb_ctrl_end_recovery(struct ctdb_context
*ctdb
, struct timeval timeout
,
470 typedef void (*client_async_callback
)(struct ctdb_context
*ctdb
,
471 uint32_t node_pnn
, int32_t res
,
472 TDB_DATA outdata
, void *callback_data
);
474 struct client_async_data
{
475 enum ctdb_controls opcode
;
476 bool dont_log_errors
;
479 client_async_callback callback
;
480 client_async_callback fail_callback
;
484 void ctdb_client_async_add(struct client_async_data
*data
,
485 struct ctdb_client_control_state
*state
);
486 int ctdb_client_async_wait(struct ctdb_context
*ctdb
,
487 struct client_async_data
*data
);
488 int ctdb_client_async_control(struct ctdb_context
*ctdb
,
489 enum ctdb_controls opcode
, uint32_t *nodes
,
490 uint64_t srvid
, struct timeval timeout
,
491 bool dont_log_errors
, TDB_DATA data
,
492 client_async_callback client_callback
,
493 client_async_callback fail_callback
,
494 void *callback_data
);
496 uint32_t *list_of_vnnmap_nodes(struct ctdb_context
*ctdb
,
497 struct ctdb_vnn_map
*vnn_map
,
498 TALLOC_CTX
*mem_ctx
, bool include_self
);
500 uint32_t *list_of_nodes(struct ctdb_context
*ctdb
,
501 struct ctdb_node_map_old
*node_map
,
502 TALLOC_CTX
*mem_ctx
, uint32_t mask
, int exclude_pnn
);
503 uint32_t *list_of_active_nodes(struct ctdb_context
*ctdb
,
504 struct ctdb_node_map_old
*node_map
,
505 TALLOC_CTX
*mem_ctx
, bool include_self
);
506 uint32_t *list_of_connected_nodes(struct ctdb_context
*ctdb
,
507 struct ctdb_node_map_old
*node_map
,
508 TALLOC_CTX
*mem_ctx
, bool include_self
);
510 int ctdb_read_pnn_lock(int fd
, int32_t pnn
);
513 get capabilities of a remote node
516 struct ctdb_client_control_state
*ctdb_ctrl_getcapabilities_send(
517 struct ctdb_context
*ctdb
,
519 struct timeval timeout
,
521 int ctdb_ctrl_getcapabilities_recv(struct ctdb_context
*ctdb
,
523 struct ctdb_client_control_state
*state
,
524 uint32_t *capabilities
);
525 int ctdb_ctrl_getcapabilities(struct ctdb_context
*ctdb
,
526 struct timeval timeout
, uint32_t destnode
,
527 uint32_t *capabilities
);
529 struct ctdb_node_capabilities
{
531 uint32_t capabilities
;
534 /* Retrieve capabilities for all connected nodes. The length of the
535 * returned array can be calculated using talloc_array_length(). */
536 struct ctdb_node_capabilities
*ctdb_get_capabilities(
537 struct ctdb_context
*ctdb
,
539 struct timeval timeout
,
540 struct ctdb_node_map_old
*nodemap
);
542 /* Get capabilities for specified node, NULL if not found */
543 uint32_t *ctdb_get_node_capabilities(struct ctdb_node_capabilities
*caps
,
546 /* True if the given node has all of the required capabilities */
547 bool ctdb_node_has_capabilities(struct ctdb_node_capabilities
*caps
,
548 uint32_t pnn
, uint32_t capabilities_required
);
551 struct ctdb_transaction_handle
*ctdb_transaction_start(
552 struct ctdb_db_context
*ctdb_db
,
553 TALLOC_CTX
*mem_ctx
);
554 int ctdb_transaction_fetch(struct ctdb_transaction_handle
*h
,
556 TDB_DATA key
, TDB_DATA
*data
);
557 int ctdb_transaction_store(struct ctdb_transaction_handle
*h
,
558 TDB_DATA key
, TDB_DATA data
);
559 int ctdb_transaction_commit(struct ctdb_transaction_handle
*h
);
560 int ctdb_transaction_cancel(struct ctdb_transaction_handle
*h
);
562 int ctdb_ctrl_recd_ping(struct ctdb_context
*ctdb
);
564 int ctdb_ctrl_getscriptstatus(struct ctdb_context
*ctdb
,
565 struct timeval timeout
, uint32_t destnode
,
567 enum ctdb_event type
,
568 struct ctdb_script_list_old
**script_status
);
570 int ctdb_ctrl_report_recd_lock_latency(struct ctdb_context
*ctdb
,
571 struct timeval timeout
, double latency
);
573 int ctdb_ctrl_getreclock(struct ctdb_context
*ctdb
,
574 struct timeval timeout
, uint32_t destnode
,
575 TALLOC_CTX
*mem_ctx
, const char **reclock
);
576 int ctdb_ctrl_setreclock(struct ctdb_context
*ctdb
,
577 struct timeval timeout
, uint32_t destnode
,
578 const char *reclock
);
580 int ctdb_ctrl_stop_node(struct ctdb_context
*ctdb
, struct timeval timeout
,
582 int ctdb_ctrl_continue_node(struct ctdb_context
*ctdb
, struct timeval timeout
,
585 int ctdb_ctrl_setnatgwstate(struct ctdb_context
*ctdb
,
586 struct timeval timeout
, uint32_t destnode
,
587 uint32_t natgwstate
);
588 int ctdb_ctrl_setlmasterrole(struct ctdb_context
*ctdb
,
589 struct timeval timeout
, uint32_t destnode
,
590 uint32_t lmasterrole
);
591 int ctdb_ctrl_setrecmasterrole(struct ctdb_context
*ctdb
,
592 struct timeval timeout
, uint32_t destnode
,
593 uint32_t recmasterrole
);
595 int ctdb_ctrl_enablescript(struct ctdb_context
*ctdb
, struct timeval timeout
,
596 uint32_t destnode
, const char *script
);
597 int ctdb_ctrl_disablescript(struct ctdb_context
*ctdb
, struct timeval timeout
,
598 uint32_t destnode
, const char *script
);
600 int ctdb_ctrl_set_ban(struct ctdb_context
*ctdb
, struct timeval timeout
,
601 uint32_t destnode
, struct ctdb_ban_state
*bantime
);
602 int ctdb_ctrl_get_ban(struct ctdb_context
*ctdb
, struct timeval timeout
,
603 uint32_t destnode
, TALLOC_CTX
*mem_ctx
,
604 struct ctdb_ban_state
**bantime
);
606 int ctdb_ctrl_set_db_priority(struct ctdb_context
*ctdb
,
607 struct timeval timeout
, uint32_t destnode
,
608 struct ctdb_db_priority
*db_prio
);
609 int ctdb_ctrl_get_db_priority(struct ctdb_context
*ctdb
,
610 struct timeval timeout
, uint32_t destnode
,
611 uint32_t db_id
, uint32_t *priority
);
613 int ctdb_ctrl_getstathistory(struct ctdb_context
*ctdb
,
614 struct timeval timeout
, uint32_t destnode
,
616 struct ctdb_statistics_list_old
**stats
);
618 struct ctdb_ltdb_header
*ctdb_header_from_record_handle(
619 struct ctdb_record_handle
*h
);
621 struct ctdb_client_control_state
*ctdb_ctrl_updaterecord_send(
622 struct ctdb_context
*ctdb
,
624 struct timeval timeout
,
626 struct ctdb_db_context
*ctdb_db
,
628 struct ctdb_ltdb_header
*header
,
630 int ctdb_ctrl_updaterecord_recv(struct ctdb_context
*ctdb
,
631 struct ctdb_client_control_state
*state
);
632 int ctdb_ctrl_updaterecord(struct ctdb_context
*ctdb
, TALLOC_CTX
*mem_ctx
,
633 struct timeval timeout
, uint32_t destnode
,
634 struct ctdb_db_context
*ctdb_db
, TDB_DATA key
,
635 struct ctdb_ltdb_header
*header
, TDB_DATA data
);
637 struct ctdb_client_control_state
*ctdb_ctrl_set_db_readonly_send(
638 struct ctdb_context
*ctdb
,
639 uint32_t destnode
, uint32_t dbid
);
640 int ctdb_ctrl_set_db_readonly_recv(struct ctdb_context
*ctdb
,
641 struct ctdb_client_control_state
*state
);
642 int ctdb_ctrl_set_db_readonly(struct ctdb_context
*ctdb
, uint32_t destnode
,
645 struct ctdb_client_control_state
*ctdb_ctrl_set_db_sticky_send(
646 struct ctdb_context
*ctdb
,
647 uint32_t destnode
, uint32_t dbid
);
648 int ctdb_ctrl_set_db_sticky_recv(struct ctdb_context
*ctdb
,
649 struct ctdb_client_control_state
*state
);
650 int ctdb_ctrl_set_db_sticky(struct ctdb_context
*ctdb
, uint32_t destnode
,
653 #endif /* _CTDB_CLIENT_H */