TDB mutex support breaks CTDB

Stefan (metze) Metzmacher metze at
Thu Dec 18 03:10:04 MST 2014

Hi Amitay,

are the patches in;a=shortlog;h=refs/heads/ctdb-wip
(the top commit;a=commitdiff;h=b55960ece236dc7c32fbbbbea986cb84b0baa987)
ready for master?

I think we need  #ifdef TDB_MUTEX_LOCKING arround uint32_t mutex_enabled
= 0;
Otherwise it looks good to me, if you tested it.

Then we could push all of them and backport for 4.2.0rc3 (which is
likely to happen
later today or tomorrow).


> On Fri, Dec 12, 2014 at 11:06 PM, Stefan (metze) Metzmacher <metze at
>> wrote:
>> Am 12.12.2014 um 06:34 schrieb Amitay Isaacs:
>>> On Thu, Dec 11, 2014 at 7:55 PM, Stefan (metze) Metzmacher <
>> metze at>
>>> wrote:
>>>> Am 11.12.2014 um 05:50 schrieb Amitay Isaacs:
>>>>> Hi Volker/Metze,
>>>>> The TDB robust mutex changes make certain assumptions which completely
>>>>> breaks CTDB.  Here are some of the findings which are causing concern.
>>>>> 1. CTDB does not always specify all the matching flags (i.e. the flags
>>>> used
>>>>> for creation) to tdb_open_ex() when opening tdb database subsequently
>> (or
>>>>> in not-first case).  This does not work for databases created with
>>>>> 2. If I specify TDB_MUTEX_LOCKING in tdb_flags for subsequent
>> (non-first)
>>>>> tdb_open_ex(), it does not work unless I also include
>>>>> If the process knows that it's not the first opener, why should it need
>>>> to
>>>>> specify TDB_CLEAR_IF_FIRST?
>>>> As indication that it's a non persistent database.
>>>>> 3. CTDB database recovery uses transactions to update the databases
>> after
>>>>> recovery.  With TDB_MUTEX_LOCKING enabled, CTDB cannot do database
>>>> recovery.
>>>> Can the all record lock be used instead of a transaction?
>>>> I wonder why we didn't notice this before...
>>> Changing from transaction to all record lock is going to be a major
>>> change.  What's the reason for not allowing transactions on mutex enabled
>>> databases?
>> I discussed this again with Volker and Michael, we all think it's ok to
>> remove
>> this restriction.
>> Please test the attached patches.
>> A possible backport will go via
>> metze
> Thanks for removing the restriction.  That makes CTDB changes simple.
> I am trying to test samba+ctdb with these changes using nbench torture
> test, however smbd is crashing in brlock.  I am not sure if this is related
> or something else is going wrong.  I have attached gdb backtrace.  If you
> have any ideas on how to debug this, please let me know.
> For this test, I am building samba+ctdb rpms from master with gpfs
> enabled.  Currently this is a hack based on fedora's samba spec file since
> our packaging/RHEL-CTDB has not yet been updated for waf build.  Once I am
> sure that rpms are working properly, I will update packaging/RHEL-CTDB.
> Amitay.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the samba-technical mailing list