diff options
author | Amitay Isaacs <amitay@gmail.com> | 2013-08-19 15:04:46 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2013-08-22 14:08:52 +1000 |
commit | 1467b666f219586a0612bd32804b0dff7a84082c (patch) | |
tree | 42ac00641d99aaa43d14df241f3a1f0273eb55d2 /ctdb/server/ctdb_call.c | |
parent | 59dae19f5a8e5cd8a62dfccdd1cfec62e9842977 (diff) | |
download | samba-1467b666f219586a0612bd32804b0dff7a84082c.tar.gz samba-1467b666f219586a0612bd32804b0dff7a84082c.tar.xz samba-1467b666f219586a0612bd32804b0dff7a84082c.zip |
Revert "LACOUNT: Add back lacount mechanism to defer migrating a fetched/read copy until after default of 20 consecutive requests from the same node"
This reverts commit 035c0d981bde8c0eee8b3f24ba8e2dc817e5b504.
This is a premature optimization. Record can bounce between nodes
very quickly if it is a contended record. There is no need to hold a
record on a node unnecessarily. In case record contention becomes bad,
enabling sticky records on a database is a better idea.
Conflicts:
include/ctdb_private.h
server/ctdb_tunables.c
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit ac417b0003f0116f116834ad2ac51482d25cfa0d)
Diffstat (limited to 'ctdb/server/ctdb_call.c')
-rw-r--r-- | ctdb/server/ctdb_call.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c index bda599acc84..017e4f575ce 100644 --- a/ctdb/server/ctdb_call.c +++ b/ctdb/server/ctdb_call.c @@ -399,7 +399,7 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db, return; } - ctdb_call_local(ctdb_db, state->call, &header, state, &data, true, ctdb->pnn); + ctdb_call_local(ctdb_db, state->call, &header, state, &data, true); ret = ctdb_ltdb_unlock(ctdb_db, state->call->key); if (ret != 0) { @@ -930,15 +930,11 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) } - /* if this nodes has done enough consecutive calls on the same record - then give them the record - or if the node requested an immediate migration - */ - if ( c->hdr.srcnode != ctdb->pnn && - ((header.laccessor == c->hdr.srcnode - && header.lacount >= ctdb->tunable.max_lacount - && ctdb->tunable.max_lacount != 0) - || (c->flags & CTDB_IMMEDIATE_MIGRATION)) ) { + /* Try if possible to migrate the record off to the caller node. + * From the clients perspective a fetch of the data is just as + * expensive as a migration. + */ + if (c->hdr.srcnode != ctdb->pnn) { if (ctdb_db->transaction_active) { DEBUG(DEBUG_INFO, (__location__ " refusing migration" " of key %s while transaction is active\n", @@ -957,7 +953,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr) } } - ret = ctdb_call_local(ctdb_db, call, &header, hdr, &data, true, c->hdr.srcnode); + ret = ctdb_call_local(ctdb_db, call, &header, hdr, &data, true); if (ret != 0) { DEBUG(DEBUG_ERR,(__location__ " ctdb_call_local failed\n")); call->status = -1; @@ -1244,7 +1240,7 @@ struct ctdb_call_state *ctdb_call_local_send(struct ctdb_db_context *ctdb_db, *(state->call) = *call; state->ctdb_db = ctdb_db; - ret = ctdb_call_local(ctdb_db, state->call, header, state, data, true, ctdb->pnn); + ret = ctdb_call_local(ctdb_db, state->call, header, state, data, true); if (ret != 0) { DEBUG(DEBUG_DEBUG,("ctdb_call_local() failed, ignoring return code %d\n", ret)); } |