[PATCH] CTDB locking changes

Amitay Isaacs amitay at gmail.com
Tue Jul 22 21:11:33 MDT 2014


Here are the patches that clean up locking in CTDB.

The major changes include:

1. Removal of multiple lock requests per context feature.

This was a really bad idea and caused out-of-order scheduling of lock
requests.  The code was already commented and not in use.

2. Immediate scheduling of lock request provided there aren't max number of
requests active.

The scheme to avoid scheduling record lock requests which are already
active, caused high CPU usage when there were lots of pending requests.
The implementation of pending and active queues using linked list is a bad
choice of data structure for this purpose.  In future, it might be possible
to improve the scheduling using per database queues rather than a single

Minor changes include:

1. Removing unused elements of data structures, unused function

2. Add a new tunable LockProcessesPerDB.  Default is 200.

3. Update num_pending statistics when lock is scheduled and not when lock
is obtained to give the correct picture of how many lock requests are still
in the pending queue.

Please review and  push if ok.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ctdb.patches
Type: application/octet-stream
Size: 26597 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140723/365b9d64/attachment.obj>

More information about the samba-technical mailing list