* - Get dbmap
* - Set RECOVERY_ACTIVE
* - Send START_RECOVERY
+ * - Update vnnmap on all nodes
* - Run database recovery
* - Send END_RECOVERY
- * - Update vnnmap on all nodes
* - Set RECOVERY_NORMAL
*/
static void recovery_dbmap_done(struct tevent_req *subreq);
static void recovery_active_done(struct tevent_req *subreq);
static void recovery_start_recovery_done(struct tevent_req *subreq);
-static void recovery_db_recovery_done(struct tevent_req *subreq);
static void recovery_vnnmap_update_done(struct tevent_req *subreq);
+static void recovery_db_recovery_done(struct tevent_req *subreq);
static void recovery_normal_done(struct tevent_req *subreq);
static void recovery_end_recovery_done(struct tevent_req *subreq);
subreq, struct tevent_req);
struct recovery_state *state = tevent_req_data(
req, struct recovery_state);
+ struct ctdb_req_control request;
int *err_list;
int ret;
bool status;
LOG("start_recovery event finished\n");
- subreq = db_recovery_send(state, state->ev, state->client,
- state->dbmap, state->tun_list,
- state->pnn_list, state->count,
- state->vnnmap->generation);
- if (tevent_req_nomem(subreq, req)) {
- return;
- }
- tevent_req_set_callback(subreq, recovery_db_recovery_done, req);
-}
-
-static void recovery_db_recovery_done(struct tevent_req *subreq)
-{
- struct tevent_req *req = tevent_req_callback_data(
- subreq, struct tevent_req);
- struct recovery_state *state = tevent_req_data(
- req, struct recovery_state);
- struct ctdb_req_control request;
- bool status;
- int count;
-
- status = db_recovery_recv(subreq, &count);
- TALLOC_FREE(subreq);
-
- LOG("%d databases recovered\n", count);
-
- if (! status) {
- tevent_req_error(req, EIO);
- return;
- }
-
ctdb_req_control_setvnnmap(&request, state->vnnmap);
subreq = ctdb_client_control_multi_send(state, state->ev,
state->client,
subreq, struct tevent_req);
struct recovery_state *state = tevent_req_data(
req, struct recovery_state);
- struct ctdb_req_control request;
int *err_list;
int ret;
bool status;
LOG("updated VNNMAP\n");
+ subreq = db_recovery_send(state, state->ev, state->client,
+ state->dbmap, state->tun_list,
+ state->pnn_list, state->count,
+ state->vnnmap->generation);
+ if (tevent_req_nomem(subreq, req)) {
+ return;
+ }
+ tevent_req_set_callback(subreq, recovery_db_recovery_done, req);
+}
+
+static void recovery_db_recovery_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req = tevent_req_callback_data(
+ subreq, struct tevent_req);
+ struct recovery_state *state = tevent_req_data(
+ req, struct recovery_state);
+ struct ctdb_req_control request;
+ bool status;
+ int count;
+
+ status = db_recovery_recv(subreq, &count);
+ TALLOC_FREE(subreq);
+
+ LOG("%d databases recovered\n", count);
+
+ if (! status) {
+ tevent_req_error(req, EIO);
+ return;
+ }
+
ctdb_req_control_set_recmode(&request, CTDB_RECOVERY_NORMAL);
subreq = ctdb_client_control_multi_send(state, state->ev,
state->client,