ctdb-readonly: Avoid a tight loop waiting for revoke to complete
commit5906140fb1f0ba1154f8754eaa3a7f6d51ef4823
authorAmitay Isaacs <amitay@gmail.com>
Thu, 18 May 2017 01:50:09 +0000 (18 11:50 +1000)
committerKarolin Seeger <kseeger@samba.org>
Tue, 30 May 2017 10:19:10 +0000 (30 12:19 +0200)
treecd5c205b5f6723978e6f492336c19a5cbb40ccd3
parent049484b65587fee2049487ceffb8c802fc0d4e37
ctdb-readonly: Avoid a tight loop waiting for revoke to complete

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

During revoking readonly delegations, if one of the nodes disappears,
then there is no point re-trying revoking readonly delegation immedately.
The database needs to be recovered before the revoke operation can
succeed.

However, if the revoke is successful, then all the write requests need
to be processed immediately before the read-only requests.  This avoids
starving write requests, in case there are read-only requests coming
from other nodes.

In deferred_call_destructor, the result of revoke is not available and
deferred calls cannot be correctly ordered.  To correctly order the
deferred calls, process them in revokechild_destructor where the result
of revoke is known.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit f5f05a644dadc0b1858c99c5f1f5af1ef80f3a28)
ctdb/server/ctdb_call.c