It isn't used, superceded by "ipreallocated".
Signed-off-by: Martin Schwenke <martin@meltin.net>
service and also send out statd notifications to all registered
clients.
-stopped
- This event is called when a node is STOPPED and can be used to
- perform additional cleanup that is required.
- Note that a stopped node is considered inactive, so it will not
- be issuing the recovered event once the cluster has recovered.
- See 91.lvs for a use of this event.
+ipreallocated
+
+ This event is triggered after releaseip and takeip events in a
+ takeover run. It can be used to reconfigure services, update
+ routing and many other things.
Additional note for takeip, releaseip, recovered:
int ctdb_log_event_script_output(struct ctdb_context *ctdb, char *str, uint16_t len);
int ctdb_ctrl_report_recd_lock_latency(struct ctdb_context *ctdb, struct timeval timeout, double latency);
-int32_t ctdb_control_stop_node(struct ctdb_context *ctdb, struct ctdb_req_control *c, bool *async_reply);
+int32_t ctdb_control_stop_node(struct ctdb_context *ctdb);
int32_t ctdb_control_continue_node(struct ctdb_context *ctdb);
void ctdb_stop_vacuuming(struct ctdb_context *ctdb);
CTDB_EVENT_RECOVERED, /* CTDB recovery finished: no args. */
CTDB_EVENT_TAKE_IP, /* IP taken: interface, IP address, netmask bits. */
CTDB_EVENT_RELEASE_IP, /* IP released: interface, IP address, netmask bits. */
- CTDB_EVENT_STOPPED, /* This node is stopped: no args. */
+ CTDB_EVENT_STOPPED, /* Deprecated, do not use. */
CTDB_EVENT_MONITOR, /* Please check if service is healthy: no args. */
CTDB_EVENT_STATUS, /* Report service status: no args. */
CTDB_EVENT_SHUTDOWN, /* CTDB shutting down: no args. */
case CTDB_CONTROL_STOP_NODE:
CHECK_CONTROL_DATA_SIZE(0);
- return ctdb_control_stop_node(ctdb, c, async_reply);
+ return ctdb_control_stop_node(ctdb);
case CTDB_CONTROL_CONTINUE_NODE:
CHECK_CONTROL_DATA_SIZE(0);
}
-struct stop_node_callback_state {
- struct ctdb_req_control *c;
-};
-
-/*
- called when the 'stopped' event script has finished
- */
-static void ctdb_stop_node_callback(struct ctdb_context *ctdb, int status, void *p)
+int32_t ctdb_control_stop_node(struct ctdb_context *ctdb)
{
- struct stop_node_callback_state *state = talloc_get_type(p, struct stop_node_callback_state);
-
- if (status != 0) {
- DEBUG(DEBUG_ERR,(__location__ " stopped event script failed (status %d)\n", status));
- ctdb->nodes[ctdb->pnn]->flags &= ~NODE_FLAGS_STOPPED;
- if (status == -ETIME) {
- ctdb_ban_self(ctdb);
- }
- }
-
- ctdb_request_control_reply(ctdb, state->c, NULL, status, NULL);
- talloc_free(state);
-}
-
-int32_t ctdb_control_stop_node(struct ctdb_context *ctdb, struct ctdb_req_control *c, bool *async_reply)
-{
- int ret;
- struct stop_node_callback_state *state;
-
DEBUG(DEBUG_INFO,(__location__ " Stopping node\n"));
-
- state = talloc(ctdb, struct stop_node_callback_state);
- CTDB_NO_MEMORY(ctdb, state);
-
- state->c = talloc_steal(state, c);
-
ctdb_disable_monitoring(ctdb);
-
- ret = ctdb_event_script_callback(ctdb, state,
- ctdb_stop_node_callback,
- state, false,
- CTDB_EVENT_STOPPED, "%s", "");
-
- if (ret != 0) {
- ctdb_enable_monitoring(ctdb);
-
- DEBUG(DEBUG_ERR,(__location__ " Failed to stop node\n"));
- talloc_free(state);
- return -1;
- }
-
ctdb->nodes[ctdb->pnn]->flags |= NODE_FLAGS_STOPPED;
- *async_reply = true;
-
return 0;
}
case CTDB_EVENT_RECOVERED:
case CTDB_EVENT_TAKE_IP:
case CTDB_EVENT_RELEASE_IP:
- case CTDB_EVENT_STOPPED:
case CTDB_EVENT_STATUS:
state->scripts->scripts[state->current].status = 0;
DEBUG(DEBUG_ERR,("Ignoring hung script for %s call %d\n", state->options, state->call));
case CTDB_EVENT_STARTUP:
case CTDB_EVENT_START_RECOVERY:
case CTDB_EVENT_RECOVERED:
- case CTDB_EVENT_STOPPED:
case CTDB_EVENT_MONITOR:
case CTDB_EVENT_STATUS:
case CTDB_EVENT_SHUTDOWN:
CTDB_EVENT_SHUTDOWN,
CTDB_EVENT_RELEASE_IP,
CTDB_EVENT_IPREALLOCATED,
- CTDB_EVENT_STOPPED
};
int i;
for (i=0;i<ARRAY_SIZE(allowed_calls);i++) {