diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2012-03-20 11:31:59 +1100 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2012-03-20 11:39:00 +1100 |
commit | c051f67d674beb52419c4c30b163db397e7861b2 (patch) | |
tree | 9778cc727e550b242a9c69870058b1b935f9b662 | |
parent | 038c946e80b9f710e5949876bbd763033ab8e5ce (diff) | |
download | samba-c051f67d674beb52419c4c30b163db397e7861b2.tar.gz samba-c051f67d674beb52419c4c30b163db397e7861b2.tar.xz samba-c051f67d674beb52419c4c30b163db397e7861b2.zip |
FETCH COLLAPSE : Change the fetch-lock collapse to collapse ALL fetches, including fetch-locks into a single command in flight per record. Also add a tunable to enable/disable this optimization for hot records
(This used to be ctdb commit eafd7bbaaa5931546a96c8beae3cf9a39a49c925)
-rw-r--r-- | ctdb/include/ctdb_private.h | 1 | ||||
-rw-r--r-- | ctdb/server/ctdb_daemon.c | 13 | ||||
-rw-r--r-- | ctdb/server/ctdb_tunables.c | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index 303995389f..aa687d4311 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -125,6 +125,7 @@ struct ctdb_tunable { uint32_t allow_client_db_attach; uint32_t recover_pdb_by_seqnum; uint32_t deferred_rebalance_on_node_add; + uint32_t fetch_collapse; }; /* diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index 65ad055b1b..a267b88e1b 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -673,11 +673,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) { @@ -790,7 +791,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 diff --git a/ctdb/server/ctdb_tunables.c b/ctdb/server/ctdb_tunables.c index 76af85d4c6..016acc4467 100644 --- a/ctdb/server/ctdb_tunables.c +++ b/ctdb/server/ctdb_tunables.c @@ -73,7 +73,8 @@ static const struct { { "DeferredAttachTO", 120, offsetof(struct ctdb_tunable, deferred_attach_timeout), false }, { "AllowClientDBAttach", 1, offsetof(struct ctdb_tunable, allow_client_db_attach), false }, { "RecoverPDBBySeqNum", 0, offsetof(struct ctdb_tunable, recover_pdb_by_seqnum), false }, - { "DeferredRebalanceOnNodeAdd", 300, offsetof(struct ctdb_tunable, deferred_rebalance_on_node_add) } + { "DeferredRebalanceOnNodeAdd", 300, offsetof(struct ctdb_tunable, deferred_rebalance_on_node_add) }, + { "FetchCollapse", 1, offsetof(struct ctdb_tunable, fetch_collapse) } }; /* |