ctdb-daemon: Fix database attach deferral logic
authorMartin Schwenke <martin@meltin.net>
Thu, 20 Feb 2020 02:48:13 +0000 (13:48 +1100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 30 Mar 2020 10:08:25 +0000 (10:08 +0000)
commitac738d067ac65596ff37bd8fb8b64e49f7548591
tree8b94c5bb380c89dc98c8f14126e7a44ef7aab38c
parent436a746ed1ac1269348066800e54511d08b0df9e
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>
(cherry picked from commit c6c89495fbe9b6f238d10a538eccc92b937a69de)
ctdb/server/ctdb_ltdb_server.c