ctdb-client: Fix implementation of transaction start
authorAmitay Isaacs <amitay@gmail.com>
Fri, 15 Apr 2016 07:44:14 +0000 (17:44 +1000)
committerMartin Schwenke <martins@samba.org>
Tue, 5 Jul 2016 08:53:14 +0000 (10:53 +0200)
commitf721035d4339d910c3cf479eee93b6539f2ef05a
treef56702c08db839d7f74c5a7e262baed59542fdf3
parent37f587de7afd01d0b663be722a28acffc7da9c39
ctdb-client: Fix implementation of transaction start

Since g_lock checks if the process exists in case of conflicting lock,
there is no need to register srvid.

Transaction start returns a transaction handle and transaction
commit/cancel will free that handle.  Since we cannot call async code
in a talloc destructor, this avoids the use of talloc destructor for
cancelling the transaction.

If user frees the transaction handle instead of calling transaction
cancel, it will leave stale g_lock lock.  This stale g_lock lock  will
get cleaned up on next transaction attempt.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/client/client_db.c