ctdb-daemon: GET_DB_SEQNUM should read database conditionally
commiteabed4d055487a6607b4b2169d88c57bf3cb8783
authorAmitay Isaacs <amitay@gmail.com>
Thu, 7 Sep 2017 07:21:03 +0000 (7 17:21 +1000)
committerKarolin Seeger <kseeger@samba.org>
Wed, 13 Sep 2017 17:52:24 +0000 (13 19:52 +0200)
tree9acaa1860b2960d8e387477e5475de3bf76dc71e
parent8c22449d65d0aac09f245b05a987361fea0c4850
ctdb-daemon: GET_DB_SEQNUM should read database conditionally

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

Once the recovery starts and databases are frozen, then all the record
access is postponed till the recovery is complete except reading the
database sequence number.  Database access for reading sequence number
is done via a control which does not check if the databases are frozen
or not.

If the database is frozen and if the freeze transaction is not started
(this can happen when a node is inactive, or during recovery when the
database is frozen but the transaction has not yet started), then trying
to read sequence number will cause ctdb daemon to deadlock.

Before reading the sequence number, check if the database access is
allowed.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit f57d379446c551bca5906247c622e857c77089b0)

Autobuild-User(v4-7-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-7-test): Wed Sep 13 19:52:24 CEST 2017 on sn-devel-144
ctdb/server/ctdb_persistent.c