ctdb-daemon: GET_DB_SEQNUM should read database conditionally
authorAmitay Isaacs <amitay@gmail.com>
Thu, 7 Sep 2017 07:21:03 +0000 (17:21 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 12 Sep 2017 10:23:18 +0000 (12:23 +0200)
commitf57d379446c551bca5906247c622e857c77089b0
tree329597d758e717bdea77599442476523caa2d037
parent5d2f2677de65a0fd6683bb759d80ebced604fa6b
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>
ctdb/server/ctdb_persistent.c