[SCM] Samba Shared Repository - branch master updated

Martin Schwenke martins at samba.org
Fri Oct 16 07:32:03 UTC 2015


The branch, master has been updated
       via  5aab31a ctdb-recovery: Update vnnmap before database recovery
      from  30460fc s4:torture: Add test case for Replay of Persistent Handle on a Single Channel.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5aab31a39a3589b910a78b96071d6aa5e6547696
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Oct 16 14:45:28 2015 +1100

    ctdb-recovery: Update vnnmap before database recovery
    
    Once the databases are recovered, all the pending calls are resent.
    If the vnnmap is not updated, then the nodes can redirect calls to nodes
    that are not part of the new vnnmap.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>
    
    Autobuild-User(master): Martin Schwenke <martins at samba.org>
    Autobuild-Date(master): Fri Oct 16 09:31:34 CEST 2015 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 ctdb/server/ctdb_recovery_helper.c | 66 +++++++++++++++++++-------------------
 1 file changed, 33 insertions(+), 33 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_recovery_helper.c b/ctdb/server/ctdb_recovery_helper.c
index 194b373..6d6a835 100644
--- a/ctdb/server/ctdb_recovery_helper.c
+++ b/ctdb/server/ctdb_recovery_helper.c
@@ -1213,9 +1213,9 @@ static bool db_recovery_recv(struct tevent_req *req, int *count)
  * - 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
  */
 
@@ -1240,8 +1240,8 @@ static void recovery_tunables_done(struct tevent_req *subreq);
 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);
 
@@ -1600,6 +1600,7 @@ static void recovery_start_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;
@@ -1627,36 +1628,6 @@ static void recovery_start_recovery_done(struct tevent_req *subreq)
 
 	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,
@@ -1674,7 +1645,6 @@ static void recovery_vnnmap_update_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;
@@ -1701,6 +1671,36 @@ static void recovery_vnnmap_update_done(struct tevent_req *subreq)
 
 	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,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list