ctdb-readonly: Avoid a tight loop waiting for revoke to complete
commitf5f05a644dadc0b1858c99c5f1f5af1ef80f3a28
authorAmitay Isaacs <amitay@gmail.com>
Thu, 18 May 2017 01:50:09 +0000 (18 11:50 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 24 May 2017 15:03:28 +0000 (24 17:03 +0200)
tree02ffe4f90267cf4b0d5d92da005df6e700e19e73
parenta50b25d0ebbe731a766f8d2ce1924b34d6041668
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>
ctdb/server/ctdb_call.c