FETCH COLLAPSE : Change the fetch-lock collapse to collapse ALL fetches, including...
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 20 Mar 2012 00:31:59 +0000 (11:31 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Fri, 11 Jan 2013 06:38:49 +0000 (17:38 +1100)
Conflicts:
server/ctdb_tunables.c

Cherry-pick-from: eafd7bbaaa5931546a96c8beae3cf9a39a49c925

include/ctdb_private.h
server/ctdb_daemon.c
server/ctdb_tunables.c

index 06b940c38db53c478abc97f091d9d50094fe99c5..dffe87c089127dc8269d03614da562d5c23af857 100644 (file)
@@ -124,6 +124,7 @@ struct ctdb_tunable {
        uint32_t allow_client_db_attach;
        uint32_t deferred_rebalance_on_node_add;
        uint32_t recover_pdb_by_seqnum;
+       uint32_t fetch_collapse;
 };
 
 /*
index 635e9eab6543bbcccc852fe1b9c9ed4daf296c9c..9955f817694ce886ca248801f6b22ebcf32e02ff 100644 (file)
@@ -669,11 +669,12 @@ static void daemon_request_call_from_client(struct ctdb_client *client,
                return;
        }
 
-       if (c->flags & CTDB_IMMEDIATE_MIGRATION) {
-               /* check if this fetch-lock request is a duplicate for a
-                  request we already have in flight. If so defer it until
-                  the first request completes.
-                */
+
+       /* check if this fetch request is a duplicate for a
+          request we already have in flight. If so defer it until
+          the first request completes.
+       */
+       if (ctdb->tunable.fetch_collapse == 1) {
                if (requeue_duplicate_fetch(ctdb_db, client, key, c) == 0) {
                        ret = ctdb_ltdb_unlock(ctdb_db, key);
                        if (ret != 0) {
@@ -785,7 +786,7 @@ static void daemon_request_call_from_client(struct ctdb_client *client,
                state = ctdb_call_local_send(ctdb_db, call, &header, &data);
        } else {
                state = ctdb_daemon_call_send_remote(ctdb_db, call, &header);
-               if (call->flags & CTDB_IMMEDIATE_MIGRATION) {
+               if (ctdb->tunable.fetch_collapse == 1) {
                        /* This request triggered a remote fetch-lock.
                           set up a deferral for this key so any additional
                           fetch-locks are deferred until the current one
index 3a50328078540ed67d5aa4b21d5cbf00ee1b2416..26c45ab87110ef3f973ef8bf0094d9006f6b7940 100644 (file)
@@ -72,6 +72,7 @@ static const struct {
        { "AllowClientDBAttach", 1, offsetof(struct ctdb_tunable, allow_client_db_attach) },
        { "DeferredRebalanceOnNodeAdd", 300, offsetof(struct ctdb_tunable, deferred_rebalance_on_node_add) },
        { "RecoverPDBBySeqNum",  1, offsetof(struct ctdb_tunable, recover_pdb_by_seqnum) },
+       { "FetchCollapse",       1, offsetof(struct ctdb_tunable, fetch_collapse) },
 };
 
 /*