[SCM] CTDB repository - branch master updated -
ctdb-1.0.65-27-g8a0df93
Ronnie Sahlberg
sahlberg at samba.org
Wed Dec 10 00:37:13 GMT 2008
The branch, master has been updated
via 8a0df9324a03b0f17772c64a9331236126c22124 (commit)
from c404d57afb2adda039e676877838927d3073df11 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 8a0df9324a03b0f17772c64a9331236126c22124
Author: root <root at test1n1.VSOFS1.COM>
Date: Wed Dec 10 12:06:51 2008 +1100
update the "ctdb recover" command.
block and wait until the clustered has completed the recovery before returning.
this makes it easier to script since it avoids the common need for
ctdb recover
... complex loop to wait for recovery to complete ...
script continues
-----------------------------------------------------------------------
Summary of changes:
tools/ctdb.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
Changeset truncated at 500 lines:
diff --git a/tools/ctdb.c b/tools/ctdb.c
index a005001..458331f 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -1433,6 +1433,10 @@ static int control_shutdown(struct ctdb_context *ctdb, int argc, const char **ar
static int control_recover(struct ctdb_context *ctdb, int argc, const char **argv)
{
int ret;
+ uint32_t generation, next_generation;
+
+ /* record the current generation number */
+ generation = get_generation(ctdb);
ret = ctdb_ctrl_freeze(ctdb, TIMELIMIT(), options.pnn);
if (ret != 0) {
@@ -1446,6 +1450,15 @@ static int control_recover(struct ctdb_context *ctdb, int argc, const char **arg
return ret;
}
+ /* wait until we are in a new generation */
+ while (1) {
+ next_generation = get_generation(ctdb);
+ if (next_generation != generation) {
+ return 0;
+ }
+ sleep(1);
+ }
+
return 0;
}
--
CTDB repository
More information about the samba-cvs
mailing list