]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Revert "ctdb-readonly: Avoid a tight loop waiting for revoke to complete"
authorAmitay Isaacs <amitay@gmail.com>
Thu, 18 May 2017 00:15:01 +0000 (10:15 +1000)
committerKarolin Seeger <kseeger@samba.org>
Thu, 1 Jun 2017 06:49:15 +0000 (08:49 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12697

This reverts commit ad758cb869ac83534993caa212abc9fe9905ec68.

This is an incomplete fix and introduces a regression.

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

ctdb/server/ctdb_call.c

index f9c2922b3bff119b75343b08c966a3ccb2e6999c..3478419fd4c0f2abbf352afa418f583cc7dd6fc1 100644 (file)
@@ -1599,6 +1599,7 @@ static int deferred_call_destructor(struct revokechild_deferred_call *deferred_c
 {
        struct ctdb_context *ctdb = deferred_call->ctdb;
        struct revokechild_requeue_handle *requeue_handle = talloc(ctdb, struct revokechild_requeue_handle);
+       struct ctdb_req_call_old *c = (struct ctdb_req_call_old *)deferred_call->hdr;
 
        requeue_handle->ctdb = ctdb;
        requeue_handle->hdr  = deferred_call->hdr;
@@ -1606,12 +1607,9 @@ static int deferred_call_destructor(struct revokechild_deferred_call *deferred_c
        requeue_handle->ctx  = deferred_call->ctx;
        talloc_steal(requeue_handle, requeue_handle->hdr);
 
-       /* Always delay revoke requests.  Either wait for the read/write
-        * operation to complete, or if revoking failed wait for recovery to
-        * complete
-        */
+       /* when revoking, any READONLY requests have 1 second grace to let read/write finish first */
        tevent_add_timer(ctdb->ev, requeue_handle,
-                        timeval_current_ofs(1, 0),
+                        timeval_current_ofs(c->flags & CTDB_WANT_READONLY ? 1 : 0, 0),
                         deferred_call_requeue, requeue_handle);
 
        return 0;