diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2012-03-20 12:20:55 +1100 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2012-03-20 12:26:22 +1100 |
commit | e7e51ddb64cb362d3417eaae7c8d7fd5a5c4ea4d (patch) | |
tree | c65e45786149b97f06f152a286b613db7eb628da /ctdb/client | |
parent | 6a493a0b08a8751ee9265047152851e00b9bf443 (diff) | |
download | samba-e7e51ddb64cb362d3417eaae7c8d7fd5a5c4ea4d.tar.gz |
LACOUNT: Add back lacount mechanism to defer migrating a fetched/read copy until after default of 20 consecutive requests from the same node
This can improve performance slightly on certain workloads where smbds frequently read from the same record
(This used to be ctdb commit 035c0d981bde8c0eee8b3f24ba8e2dc817e5b504)
Diffstat (limited to 'ctdb/client')
-rw-r--r-- | ctdb/client/ctdb_client.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index 1b4143985fe..9f4e8fd69d2 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -71,7 +71,7 @@ struct ctdb_req_header *_ctdbd_allocate_pkt(struct ctdb_context *ctdb, */ int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call, struct ctdb_ltdb_header *header, TALLOC_CTX *mem_ctx, - TDB_DATA *data, bool updatetdb) + TDB_DATA *data, bool updatetdb, uint32_t caller) { struct ctdb_call_info *c; struct ctdb_registered_call *fn; @@ -106,7 +106,15 @@ int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call, } /* we need to force the record to be written out if this was a remote access */ - if (c->new_data == NULL) { + if (header->laccessor != caller) { + header->lacount = 0; + } + header->laccessor = caller; + header->lacount++; + + /* we need to force the record to be written out if this was a remote access, + so that the lacount is updated */ + if (c->new_data == NULL && header->laccessor != ctdb->pnn) { c->new_data = &c->record_data; } @@ -386,7 +394,7 @@ static struct ctdb_client_call_state *ctdb_client_call_local_send(struct ctdb_db *(state->call) = *call; state->ctdb_db = ctdb_db; - ret = ctdb_call_local(ctdb_db, state->call, header, state, data, true); + ret = ctdb_call_local(ctdb_db, state->call, header, state, data, true, ctdb->pnn); if (ret != 0) { DEBUG(DEBUG_DEBUG,("ctdb_call_local() failed, ignoring return code %d\n", ret)); } |