Rev 485: get parents idea of recmode and recmaster when deciding if we should do a takeover run in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Wed Jun 6 11:56:55 GMT 2007


------------------------------------------------------------
revno: 485
revision-id: tridge at samba.org-20070606115654-7fqbek6uoxforwen
parent: tridge at samba.org-20070606113436-6bo9s8zewul2xwjk
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Wed 2007-06-06 21:56:54 +1000
message:
  get parents idea of recmode and recmaster when deciding if we should do a takeover run
modified:
  common/ctdb_recoverd.c         recoverd.c-20070503213540-bvxuyd9jm1f7ig90-1
=== modified file 'common/ctdb_recoverd.c'
--- a/common/ctdb_recoverd.c	2007-06-06 11:27:09 +0000
+++ b/common/ctdb_recoverd.c	2007-06-06 11:56:54 +0000
@@ -996,8 +996,17 @@
 	}
 
 	nodemap->nodes[i].flags = c->flags;
+
+	ret = ctdb_ctrl_getrecmaster(ctdb, CONTROL_TIMEOUT(), 
+				     CTDB_CURRENT_NODE, &ctdb->recovery_master);
+
+	if (ret == 0) {
+		ret = ctdb_ctrl_getrecmode(ctdb, CONTROL_TIMEOUT(), 
+					   CTDB_CURRENT_NODE, &ctdb->recovery_mode);
+	}
 	
-	if (ctdb->recovery_master == ctdb->vnn &&
+	if (ret == 0 &&
+	    ctdb->recovery_master == ctdb->vnn &&
 	    ctdb->recovery_mode == CTDB_RECOVERY_NORMAL &&
 	    ctdb->takeover.enabled) {
 		ret = ctdb_takeover_run(ctdb, nodemap);



More information about the samba-cvs mailing list