mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
4cd06a330e
In ctdb_client.c:ctdb_transaction_commit(), after a failed TRANS2_COMMIT control call (for instance due to the 1-second being exceeded waiting for a busy node's reply), there is a 1-second gap between the transaction_cancel() and replay_transaction() calls in which there is no lock on the persistent db. And due to the lack of global state indicating that a transaction is in progress in ctdbd, other nodes may succeed to start transactions on the db in this gap and even worse work on top of the possibly already pushed changes. So the data diverges on the several nodes. This change fixes this by introducing global state for a transaction commit being active in the ctdb_db_context struct and in a db_id field in the client so that a client keeps track of _which_ tdb it as transaction commit running on. These data are set by ctdb upon entering the trans2_commit control and they are cleared in the trans2_error or trans2_finished controls. This makes it impossible to start a nother transaction or migrate a record to a different node while a transaction is active on a persistent tdb, including the retry loop. This approach is dead lock free and still allows recovery process to be started in the retry-gap between cancel and replay. Also note, that this solution does not require any change in the client side. This was debugged and developed together with Stefan Metzmacher <metze@samba.org> - thanks! Michael (This used to be ctdb commit f88103516e5ad723062fb95fcb07a128f1069d69) |
||
---|---|---|
.. | ||
client | ||
common | ||
config | ||
doc | ||
ib | ||
include | ||
lib | ||
packaging | ||
server | ||
tcp | ||
tests | ||
tools | ||
utils | ||
web | ||
.bzrignore | ||
.gitignore | ||
aclocal.m4 | ||
autogen.sh | ||
config.guess | ||
config.mk | ||
config.sub | ||
configure.ac | ||
configure.rpm | ||
COPYING | ||
ctdb.pc.in | ||
install-sh | ||
Makefile.in |