ctdb-daemon: GET_DB_SEQNUM should read database conditionally
commitc258b783e013f7832873bbe9404aeaa60aed9e96
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 16:48:58 +0000 (13 18:48 +0200)
tree9022c1efef3e47a1fa8e90c37843dcf5cbeeefbb
parent9b93e4476dbebea6c6fe4991e8e4445254858ab6
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-6-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-6-test): Wed Sep 13 18:48:58 CEST 2017 on sn-devel-144
ctdb/server/ctdb_persistent.c