From: Ronnie Sahlberg Date: Wed, 22 Aug 2007 23:53:10 +0000 (+1000) Subject: create an enum to describe the state of a control in flight instead of X-Git-Tag: tevent-0.9.20~348^2~2435^2~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=277cdbe3d10c4d7dacc69a3c3bad06c0e7fac6df;p=thirdparty%2Fsamba.git create an enum to describe the state of a control in flight instead of using the enum that is for calls (This used to be ctdb commit f9cf7076151af983a1c4ea56fbeb6d94ea508a34) --- diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index b569a69c8d8..19b19f489a4 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -661,12 +661,14 @@ int ctdb_fetch(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx, } +enum control_state {CTDB_CONTROL_WAIT, CTDB_CONTROL_DONE, CTDB_CONTROL_ERROR}; + struct ctdb_client_control_state { struct ctdb_context *ctdb; uint32_t reqid; int32_t status; TDB_DATA outdata; - enum call_state state; + enum control_state state; char *errormsg; }; @@ -705,7 +707,7 @@ static void ctdb_client_reply_control(struct ctdb_context *ctdb, talloc_steal(state, c); - state->state = CTDB_CALL_DONE; + state->state = CTDB_CONTROL_DONE; } @@ -758,7 +760,7 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid, state->ctdb = ctdb; state->reqid = ctdb_reqid_new(ctdb, state); - state->state = CTDB_CALL_WAIT; + state->state = CTDB_CONTROL_WAIT; state->errormsg = NULL; talloc_set_destructor(state, ctdb_control_destructor); @@ -796,7 +798,7 @@ int ctdb_control(struct ctdb_context *ctdb, uint32_t destnode, uint64_t srvid, if (timeout && !timeval_is_zero(timeout)) { event_add_timed(ctdb->ev, state, *timeout, timeout_func, &timed_out); } - while ((state->state == CTDB_CALL_WAIT) + while ((state->state == CTDB_CONTROL_WAIT) && (timed_out == 0) ){ event_loop_once(ctdb->ev); } diff --git a/ctdb/doc/ctdb.1 b/ctdb/doc/ctdb.1 index af75cb28c38..a39de9b6ca7 100644 --- a/ctdb/doc/ctdb.1 +++ b/ctdb/doc/ctdb.1 @@ -1,11 +1,11 @@ .\" Title: ctdb .\" Author: .\" Generator: DocBook XSL Stylesheets v1.71.0 -.\" Date: 08/03/2007 +.\" Date: 08/23/2007 .\" Manual: .\" Source: .\" -.TH "CTDB" "1" "08/03/2007" "" "" +.TH "CTDB" "1" "08/23/2007" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -31,7 +31,7 @@ The virtual node number is an integer that describes the node in the cluster. Th .PP \-Y .RS 3n -Produce output in machinereadable form for easier parsing by scripts. Not all commands support this option. +Produce output in machine readable form for easier parsing by scripts. Not all commands support this option. .RE .PP \-t @@ -78,7 +78,7 @@ Node status reflects the current status of the node. There are four possible sta .PP OK \- This node is fully functional. .PP -DISCONNECTED \- This node could not be connected through the network and is currently not parcipitating in the cluster. If there is a public IP address associated with this node it should have been taken over by a different node. No services are running on this node. +DISCONNECTED \- This node could not be connected through the network and is currently not participating in the cluster. If there is a public IP address associated with this node it should have been taken over by a different node. No services are running on this node. .PP DISABLED \- This node has been administratively disabled. This node is still functional and participates in the CTDB cluster but its IP addresses have been taken over by a different node and no services are currently being hosted. .PP @@ -104,7 +104,7 @@ The generation id is a number that indicates the current generation of a cluster \fBVNNMAP\fR .RS .PP -The list of Virtual Node Numbers. This is a list of all nodes that actively participates in the cluster and that share the workload of hosting the Clustered TDB database records. Only nodes that are parcipitating in the vnnmap can become lmaster or dmaster for a database record. +The list of Virtual Node Numbers. This is a list of all nodes that actively participates in the cluster and that share the workload of hosting the Clustered TDB database records. Only nodes that are participating in the vnnmap can become lmaster or dmaster for a database record. .RE .sp .it 1 an-trap diff --git a/ctdb/doc/ctdb.1.html b/ctdb/doc/ctdb.1.html index ec514f070ff..23dfda09da7 100644 --- a/ctdb/doc/ctdb.1.html +++ b/ctdb/doc/ctdb.1.html @@ -8,7 +8,7 @@ The virtual node number is an integer that describes the node in the cluster. The first node has virtual node number 0.

-Y

- Produce output in machinereadable form for easier parsing by scripts. Not all commands support this option. + Produce output in machine readable form for easier parsing by scripts. Not all commands support this option.

-t <timeout>

How long should ctdb wait for a command to complete before timing out. Default is 3 seconds.

-? --help

@@ -24,36 +24,36 @@ You only need to specify this parameter if you run multiple ctdb daemons on the same physical host and thus can not use the default name for the domain socket. -

Administrative Commands

+

Administrative Commands

These are commands used to monitor and administrate a CTDB cluster. -

status

+

status

This command shows the current status of the ctdb node. -

node status

+

node status

Node status reflects the current status of the node. There are four possible states:

OK - This node is fully functional.

- DISCONNECTED - This node could not be connected through the network and is currently not parcipitating in the cluster. If there is a public IP address associated with this node it should have been taken over by a different node. No services are running on this node. + DISCONNECTED - This node could not be connected through the network and is currently not participating in the cluster. If there is a public IP address associated with this node it should have been taken over by a different node. No services are running on this node.

DISABLED - This node has been administratively disabled. This node is still functional and participates in the CTDB cluster but its IP addresses have been taken over by a different node and no services are currently being hosted.

UNHEALTHY - A service provided by this node is malfunctioning and should be investigated. The CTDB daemon itself is operational and participates in the cluster. Its public IP address has been taken over by a different node and no services are currnetly being hosted. All unhealthy nodes should be investigated and require an administrative action to rectify.

BANNED - This node failed too many recovery attempts and has been banned from participating in the cluster for a period of RecoveryBanPeriod seconds. Any public IP address has been taken over by other nodes. This node does not provide any services. All banned nodes should be investigated and require an administrative action to rectify. This node does not perticipate in the CTDB cluster but can still be communicated with. I.e. ctdb commands can be sent to it. -

generation

+

generation

The generation id is a number that indicates the current generation of a cluster instance. Each time a cluster goes through a reconfiguration or a recovery its generation id will be changed. -

VNNMAP

+

VNNMAP

The list of Virtual Node Numbers. This is a list of all nodes that actively participates in the cluster and that share the workload of hosting the Clustered TDB database records. - Only nodes that are parcipitating in the vnnmap can become lmaster or dmaster for a database record. -

Recovery mode

+ Only nodes that are participating in the vnnmap can become lmaster or dmaster for a database record. +

Recovery mode

This is the current recovery mode of the cluster. There are two possible modes:

NORMAL - The cluster is fully operational.

RECOVERY - The cluster databases have all been frozen, pausing all services while the cluster awaits a recovery process to complete. A recovery process should finish within seconds. If a cluster is stuck in the RECOVERY state this would indicate a cluster malfunction which needs to be investigated. -

Recovery master

+

Recovery master

This is the cluster node that is currently designated as the recovery master. This node is responsible of monitoring the consistency of the cluster and to perform the actual recovery process when reqired.

Example: ctdb status @@ -94,7 +94,7 @@ Number of nodes:4 12.1.1.2 1 12.1.1.3 2 12.1.1.4 3 -

getvar <name>

+

getvar <name>

Get the runtime value of a tuneable variable.

Example: ctdb getvar MaxRedirectCount @@ -170,7 +170,7 @@ CTDB version 1 max_hop_count 0 max_call_latency 4.948321 sec max_lockwait_latency 0.000000 sec -

statisticsreset

+

statisticsreset

This command is used to clear all statistics counters in a node.

Example: ctdb statisticsreset @@ -178,14 +178,14 @@ CTDB version 1 Get the current debug level for the node. the debug level controls what information is written to the log file.

setdebug <debuglevel>

Set the debug level of a node. This is a number between 0 and 9 and controls what information will be written to the logfile. -

getpid

+

getpid

This command will return the process id of the ctdb daemon.

disable

This command is used to administratively disable a node in the cluster. A disabled node will still participate in the cluster and host clustered TDB records but its public ip address has been taken over by a different node and it no longer hosts any services. -

enable

+

enable

Re-enable a node that has been administratively disabled.

ban <bantime|0>

Administratively ban a node for bantime seconds. A bantime of 0 means that the node should be permanently banned. @@ -221,7 +221,7 @@ CTDB version 1

Debugging Commands

These commands are primarily used for CTDB development and testing and should not be used for normal administration. -

process-exists <pid>

+

process-exists <pid>

This command checks if a specific process exists on the CTDB host. This is mainly used by Samba to check if remote instances of samba are still running or not.

getdbmap

This command lists all clustered TDB databases that the CTDB daemon has attahced to. diff --git a/ctdb/doc/ctdbd.1 b/ctdb/doc/ctdbd.1 index a50aa3fe64f..d853126e6e7 100644 --- a/ctdb/doc/ctdbd.1 +++ b/ctdb/doc/ctdbd.1 @@ -1,11 +1,11 @@ .\" Title: ctdbd .\" Author: .\" Generator: DocBook XSL Stylesheets v1.71.0 -.\" Date: 07/10/2007 +.\" Date: 08/23/2007 .\" Manual: .\" Source: .\" -.TH "CTDBD" "1" "07/10/2007" "" "" +.TH "CTDBD" "1" "08/23/2007" "" "" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) @@ -179,7 +179,7 @@ There are five possible for a node. .PP OK \- This node is fully functional. .PP -DISCONNECTED \- This node could not be connected through the network and is currently not parcipitating in the cluster. If there is a public IP address associated with this node it should have been taken over by a different node. No services are running on this node. +DISCONNECTED \- This node could not be connected through the network and is currently not particpating in the cluster. If there is a public IP address associated with this node it should have been taken over by a different node. No services are running on this node. .PP DISABLED \- This node has been administratively disabled. This node is still functional and participates in the CTDB cluster but its IP addresses have been taken over by a different node and no services are currently being hosted. .PP diff --git a/ctdb/doc/ctdbd.1.html b/ctdb/doc/ctdbd.1.html index 90b8be1113f..526aff350e1 100644 --- a/ctdb/doc/ctdbd.1.html +++ b/ctdb/doc/ctdbd.1.html @@ -138,7 +138,7 @@ OK - This node is fully functional.

DISCONNECTED - This node could not be connected through the network - and is currently not parcipitating in the cluster. If there is a + and is currently not particpating in the cluster. If there is a public IP address associated with this node it should have been taken over by a different node. No services are running on this node.