]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-daemon: Respect CTDB_CTRL_FLAG_ATTACH_RECOVERY when attaching databases
authorMartin Schwenke <martin@meltin.net>
Wed, 26 Feb 2020 00:50:09 +0000 (11:50 +1100)
committerMartin Schwenke <martins@samba.org>
Mon, 23 Mar 2020 23:45:38 +0000 (23:45 +0000)
This is currently only set by the recovery daemon when it attaches
missing databases, so there is no obvious behaviour change.  However,
attaching missing databases can now be moved to the recovery helper as
long as it sets this flag.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14294

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_ltdb_server.c

index a6709ff72de967854e5b16828568fb630304a975..e050b7304fe5f5a04320035a474683b43ebe0fb7 100644 (file)
@@ -1135,7 +1135,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb,
                        return -1;
                }
 
-               if (client->pid != ctdb->recoverd_pid &&
+               if (!(c->flags & CTDB_CTRL_FLAG_ATTACH_RECOVERY) &&
                    (ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE ||
                     ctdb->runstate < CTDB_RUNSTATE_STARTUP)) {
                        struct ctdb_deferred_attach_context *da_ctx = talloc(client, struct ctdb_deferred_attach_context);