s3:dbwrap_ctdb: fix a race in starting concurrent transactions on a single node
commitd741eee4c90f0b6730b427d858740ddf0fff7fa7
authorMichael Adam <obnox@samba.org>
Wed, 28 Oct 2009 00:54:04 +0000 (28 01:54 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 26 Nov 2009 10:40:34 +0000 (26 11:40 +0100)
tree8a624bcdfe0935b88eb33f7f744b76ce1633f706
parent114d73ff98c4be6c98d18b346bce228bacf18ba1
s3:dbwrap_ctdb: fix a race in starting concurrent transactions on a single node

There are two races in concurrent transactions on a single node.
One in starting a transaction and one with replay during commit.

This commit closes the first race by storing the client pid in the
transaction-lock record and comparing the stored pid against its own
pid after releasing the lock and refetching the record inside the
transaction.

Michael

Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 7b37b8a5dcc08817b21e12570da6632674cc7575)
source3/lib/dbwrap_ctdb.c