Rev 283: report number of frozen/thawed nodes in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Sat May 12 05:44:56 GMT 2007


------------------------------------------------------------
revno: 283
revision-id: tridge at samba.org-20070512054456-hq4sgzwco9ovtb0x
parent: tridge at samba.org-20070512054435-rqvdnu9lqvzlf3s1
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Sat 2007-05-12 15:44:56 +1000
message:
  report number of frozen/thawed nodes
modified:
  tools/ctdb_control.c           ctdb_control.c-20070426122705-9ehj1l5lu2gn9kuj-1
=== modified file 'tools/ctdb_control.c'
--- a/tools/ctdb_control.c	2007-05-12 05:15:27 +0000
+++ b/tools/ctdb_control.c	2007-05-12 05:44:56 +0000
@@ -806,7 +806,7 @@
  */
 static int control_freeze(struct ctdb_context *ctdb, int argc, const char **argv)
 {
-	int ret=0;
+	int ret=0, count=0;
 	uint32_t vnn, i;
 	uint32_t *nodes;
 	uint32_t num_nodes;
@@ -830,9 +830,12 @@
 		int res = ctdb_ctrl_freeze(ctdb, timeval_current_ofs(5, 0), nodes[i]);
 		if (res != 0) {
 			printf("Warning: Unable to freeze node %u\n", nodes[i]);
+		} else {
+			count++;
 		}
 		ret |= res;
 	}
+	printf("Froze %u nodes\n", count);
 	talloc_free(nodes);
 	return 0;
 }
@@ -842,7 +845,7 @@
  */
 static int control_thaw(struct ctdb_context *ctdb, int argc, const char **argv)
 {
-	int ret=0;
+	int ret=0, count=0;
 	uint32_t vnn, i;
 	uint32_t *nodes;
 	uint32_t num_nodes;
@@ -866,9 +869,12 @@
 		int res = ctdb_ctrl_thaw(ctdb, timeval_current_ofs(5, 0), nodes[i]);
 		if (res != 0) {
 			printf("Warning: Unable to thaw node %u\n", nodes[i]);
+		} else {
+			count++;
 		}
 		ret |= res;
 	}
+	printf("Thawed %u nodes\n", count);
 	talloc_free(nodes);
 	return 0;
 }



More information about the samba-cvs mailing list