1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
samba-mirror/ctdb
Volker Lendecke f6ea3e6bcf Make fetch_locked more scalable
This patch improves the handling of the fetch_lock operation on non-persistent
databases that ctdb clients have to do very frequently.

The normal flow how this goes is the following:

1. Client does a local fetch_lock on the database

2. Client looks if the local node is dmaster.
   If yes, everything is fine
   If no, continue here

3. Client unlocks the local record

4. Client issues a "get me the record" call to ctdbd

5. ctdbd goes out and fetches the dmaster role

6. ctdbd tells the client to retry

7. Client starts over again

The problem is between step 6 and 7: Before the client has had the chance to
retry (i.e. catch the record with a fetch_locked), another node might have come
asking ctdbd to migrate away the record again. This is a real problem, I've
seen >20 loops of this kind in real workloads.

This patch does the following: Whenever ctdb receives a record as result of
step 5, it puts the key on a "holdback list". As long as a key is on this list,
a request to migrate away the dmaster is put on hold. It is the client's duty
to issue the "CTDB_CONTROL_GOTIT" control when it has successfully done step 2
after having asked ctdb to fetch the record. This will release the key from the
"holdback list" and re-issue all dmaster migration requests.

As a safeguard against malicious clients, once a second (default 1000msecs,
tunable "HoldbackCleanupInterval" in milliseconds) ctdbd goes over the list of
held back keys, deletes them and releases all held back migration requests.

(This used to be ctdb commit 5736e17c139c9a8049e235429aeae0c6c9d0e93d)
2009-12-12 00:45:39 +01:00
..
client client: lower level of commit retry message WARNING->DEBUG 2009-12-09 21:56:59 +01:00
common eventscript: expost call names and enum 2009-12-08 01:47:13 +10:30
config Bond devices can have any name the user configures, so 2009-12-09 11:33:04 +11:00
doc Document the procedure to remove/change the NATGW configuration at 2009-12-04 08:33:56 +11:00
ib Whitespace changes and using the CTDB_NO_MEMORY() macro changes to 2009-05-21 11:49:16 +10:00
include Make fetch_locked more scalable 2009-12-12 00:45:39 +01:00
lib Import "talloc_array_length" from upstream talloc 2009-12-12 00:45:39 +01:00
packaging version 1.0.108 2009-12-07 19:04:41 +11:00
server Make fetch_locked more scalable 2009-12-12 00:45:39 +01:00
tcp tcp: don't log an error when we succefully bind to the desired address 2009-10-26 14:20:23 +11:00
tests tests: temporarily disable the transaction test tool. 2009-12-12 00:45:39 +01:00
tools ctdb: scriptstatus can now query non-monitor events 2009-12-08 01:50:55 +10:30
utils From William Jojo <w.jojo[AT]hvcc.edu> 2009-06-04 09:41:05 +10:00
web fix the git path to the repository 2009-05-25 12:15:13 +10:00
.bzrignore more code rearrangement 2007-06-07 22:16:48 +10:00
.gitignore From Mathieu Parent <math.parent@gmail.com> 2009-04-08 09:21:11 +10:00
aclocal.m4 initial version 2006-11-18 10:41:20 +11:00
autogen.sh From Mathieu Parent <math.parent@gmail.com> 2009-04-08 09:21:11 +10:00
config.guess Revert "try to restart statd everytime it fails, not just the first time" 2009-09-15 19:33:35 +10:00
config.mk minor back-merge from samba4 2007-07-10 18:13:47 +10:00
config.sub Revert "try to restart statd everytime it fails, not just the first time" 2009-09-15 19:33:35 +10:00
configure.ac remove the obsolete ipmux component. 2009-05-25 12:33:52 +10:00
configure.rpm fixed permissions on configure.rpm 2008-04-22 16:48:25 +02:00
COPYING add a licence file 2009-02-07 08:10:34 +11:00
ctdb.pc.in (This used to be ctdb commit b0718551f55d5da9be0e6aba233f57c1ff8509be) 2009-04-08 09:14:20 +10:00
install-sh initial version 2006-11-18 10:41:20 +11:00
Makefile.in add an in memory ringbuffer where we store the last 500000 log entries regardless of log level. 2009-11-18 12:44:18 +11:00