Error in ctdb transactions (commit 84e5a55a)

Michael Adam obnox at
Thu Jul 28 02:05:47 MDT 2011

Hi Rusty,

the commit you are referring to, is in ctdb's example client
implementation of ctdb transactions. This code is not used
anywhere in production (if I am not mistaken). The ctdb
client implementation is only used in ctdb's selftest.

Samba has its own client  implementation which was rewritten
after that commit.  There was a similar change in the
samba-implementation (which is in source3/lib/dbwrap_ctdb.c), but
the rewrite using a global lock (g_lock) was done after that.
I knew that the ctdb client should have been rewritten
and the code for the transactions unified (and more of it
put in the server, possibly), but I did not yet get the time
to work on that... :-)

I am going to have a look at the samba implementation to check
if it would still suffer from the same problem. More later...

Cheers - Michael

Rusty Russell wrote:
> Hi all,
>    A customer had a corrupt tdb; the __transaction_lock__ record wasn't
> in the hash.  This is possible because we write to that record outside
> of a transaction in ctdb_transaction_fetch_start(), due to commit
> "ctdb_client: fix race in starting concurrent transactions on a single
> node".
> Can we just start the transaction at the top of this function, rather
> than doing the chainlock and dance we do now?  Do we still need the
> ctdb_ctrl_transaction_active() check if we do that?  I assume we do, and
> should back off in that case...
> Thanks,
> Rusty.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
URL: <>

More information about the samba-technical mailing list