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
(This used to be ctdb commit
8a0df9324a03b0f17772c64a9331236126c22124)
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) {
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;
}