ctdb-daemon: Fix database attach deferral logic
commitc6c89495fbe9b6f238d10a538eccc92b937a69de
authorMartin Schwenke <martin@meltin.net>
Thu, 20 Feb 2020 02:48:13 +0000 (20 13:48 +1100)
committerMartin Schwenke <martins@samba.org>
Mon, 23 Mar 2020 23:45:37 +0000 (23 23:45 +0000)
treeff815602ddcacfedb733d1dc38a849c925ace5c1
parent1c56d6413f86cc15ebac232f39ef1e2a53ae4297
ctdb-daemon: Fix database attach deferral logic

Commit 3cc230b5eeca749ab68d19cfda969f72c269f1f6 says:

  Dont allow clients to connect to databases untile we are well past
  and through the initial recovery phase

It is unclear what this commit was attempting to do.  The commit
message implies that more attaches should be deferred but the code
change adds a conjunction that causes less attaches to be deferred.
In particular, no attaches will be deferred after startup is complete.
This seems wrong.

To implement what seems to be stated in the commit message an "or"
needs to be used so that non-recovery daemon attaches are deferred
either when in recovery or before startup is complete.  Making this
change highlights that attaches need to be allowed during the
"startup" event because this is when smbd is started.

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