| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes it consistent with Samba, to ease transition.
Update unit test code to link to with tdb_wrap instead of including
db_wrap.c.
There are some potential whitespace fixes in this commit that have
been ignored. CTDB's lib/tdb_wrap will be deleted after the
transition to Samba's lib/tdb_wrap, so there's no point polishing it
too much.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
|
|
|
|
|
|
|
|
|
| |
This removes data types and structure elements related to TRANS2
persistent transaction code.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 22a253b7ccf1ff854cddf0b67969dc84d7d6a654)
|
|
|
|
| |
(This used to be ctdb commit f8bf99de3a5f56be67aaa67ed836458b1cf73e86)
|
|
|
|
|
|
| |
Signed-off-by: Michael Adam <obnox@samba.org>
(This used to be ctdb commit 87c89b7c2a14e2ee79a3efc7e8125842bc04bf23)
|
|
|
|
|
|
| |
Signed-off-by: Michael Adam <obnox@samba.org>
(This used to be ctdb commit 6455ce5e4980a63d56ed30f7059869c8356c12ea)
|
|
|
|
|
|
| |
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(This used to be ctdb commit 0681014ca5ed2a9b56f63fdace7f894beccf8a9a)
|
|
|
|
|
|
|
| |
It is very misleading in ctdb_persistent.c, since it is used for non-persistent
dbs...
(This used to be ctdb commit a956fa3a27106d0154a3fb46987d61c0a6b7c768)
|
|
|
|
|
|
|
|
|
|
| |
since"
This reverts commit 11dee7f3f881494cf5089d6c69fd40e74f07e670.
Try to solve this a different way so that ctdb_ltb_store() becomes safe to use also from child context
(This used to be ctdb commit 5990fe65a9cc37933ceff15d4cb2ab3b3a0addb6)
|
|
|
|
|
|
|
|
| |
it sometimes (for empty records) needs to be able to initiate traffic unde rhte daemon context.
This should furhter updated later to allow the use also from non-daemon context.
(This used to be ctdb commit 11dee7f3f881494cf5089d6c69fd40e74f07e670)
|
|
|
|
| |
(This used to be ctdb commit 1fea9ef55a6a9d201ad1b49583451ac3e6b1c66d)
|
|
|
|
|
|
|
|
| |
This function walks all databases and checks for running trans3 commits.
It sends replies to all of them (with error code) and ends them.
To be called when a recovery finishes.
(This used to be ctdb commit 70ba153b532528bdccea70c5ea28972257f384c1)
|
|
|
|
|
|
|
|
|
|
|
| |
The db_id is tracked in the client context as an indication that a
transaction commit is in progress. This is cleared in the persistent_state
talloc destructor.
This is in order to properly treat running trans3_commits if the client
disconnects.
(This used to be ctdb commit e886ff24f4e3e250944289db95916b948893d26c)
|
|
|
|
|
|
| |
This should actually never happen.
(This used to be ctdb commit f416e76838fe2adf629d4356d1cc87054b1af164)
|
|
|
|
|
|
|
|
|
| |
Make sure that ctdb_db->persistent_state is correctly NULL-ed when
the state is freed. This way, we can use ctdb_db->persistent_state
as an indication for whether a transaction commit is currently
running.
(This used to be ctdb commit 761cb235193564a0f337d0308f0a9e6de0ef2710)
|
|
|
|
| |
(This used to be ctdb commit a14917c983c3b9bbbf38f5ddeecdbbe5bde32364)
|
|
|
|
| |
(This used to be ctdb commit d871a38978219e004833608c11aae98fe47614b9)
|
|
|
|
|
|
| |
ctdb_persistent_callback
(This used to be ctdb commit 2c2d1646eb753ea9561f085bcb101153267b052b)
|
|
|
|
|
|
|
| |
and stop processing of the update_record replies in order to let
the recovery finish the trans3_commit control.
(This used to be ctdb commit cab95570dc1eefb08abbac5ae411c29f699b51cc)
|
|
|
|
|
|
|
|
|
|
|
| |
recovery
If a recovery was started, then all further processing of the update_record
controls sent by the trans3_commit control and timing them out is disabled.
The recovery should trigger sending the reply for the update record control
when finished.
(This used to be ctdb commit 983c1ca2e18ecd60fca69bfe9e116125cc695857)
|
|
|
|
|
|
|
|
|
|
| |
recovery
If a recovery was started, then all further processing of the update_record
controls sent by the trans3_commit control is disabled. The recovery should
trigger sending the reply for the update record control when finished.
(This used to be ctdb commit 12cf0619255b12230843cd8bb49cbfdea376ca2f)
|
|
|
|
|
|
|
|
|
| |
scheduler for the child.
Use ctdb_fork() from callers where we dont want the child to be running
at real-time privilege.
(This used to be ctdb commit 58795a4c9e0624e20fa3e0023b65127053edd103)
|
|
|
|
| |
(This used to be ctdb commit 1919e949af4641ffe919123e44b02fb87c13ab9f)
|
|
|
|
|
|
| |
everywhere instead of manipulating the coutenrs directly.
(This used to be ctdb commit 2e648df890e5713bc575965d87937827b068d0d7)
|
|\
| |
| |
| | |
(This used to be ctdb commit 13e58d92f5f1723e850a82ae030d0ca57e89b1ee)
|
| |
| |
| |
| |
| |
| |
| |
| | |
This means we can distinguish which child is logging, esp. via syslog where we have no pid.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(This used to be ctdb commit 68b3761a0874429b90731741f0531f76dcfbb081)
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
In Samba this is now called "tevent", and while we use the backwards
compatibility wrappers they don't offer EVENT_FD_AUTOCLOSE: that is now
a separate tevent_fd_set_auto_close() function.
This is based on Samba version 7f29f817fa939ef1bbb740584f09e76e2ecd5b06.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(This used to be ctdb commit 85e5e760cc91eb3157d3a88996ce474491646726)
|
|
|
|
| |
(This used to be ctdb commit eae1d4f9e52e73b4d8769868fffdafa590d03784)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Depending on --max-persistent-check-errors we allow ctdb
to start with unhealthy persistent databases.
The default is 0 which means to reject a startup with
unhealthy dbs.
The health of the persistent databases is checked after each
recovery. Node monitoring and the "startup" is deferred
until all persistent databases are healthy.
Databases can become healthy automaticly by a completely
HEALTHY node joining the cluster. Or by an administrator
with "ctdb backupdb/restoredb" or "ctdb wipedb".
metze
(This used to be ctdb commit 15f133d5150ed1badb4fef7d644f10cd08a25cb5)
|
|
|
|
|
|
| |
Michael
(This used to be ctdb commit a7e3b5fac6b3f5d74473f26eb86c067b35647996)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a simplified version of the trans2 commit control:
It just rolls out the marshall buffer to all active nodes.
It is the main ctdbd part of the re-implementation of the
persistent transactions. The client code is changed to
take a global lock to start a transactions and store into
the marshal buffer instead of writing to the local tdb
under a local transaction.
The old transaction implementation is going to be
removed in a later commit.
Michael
(This used to be ctdb commit f66428f9d2013080a414404c1ba6117888352fd6)
|
|
|
|
|
|
|
|
|
|
|
| |
This needs to be done after the control-dispatcher:
In the TRANS2_COMMIT control, the client->db_id needs
to be set before bailing out, since otherwise the
next TRANS2_COMMIT_RETRY will fail...
Michael
(This used to be ctdb commit 59faf3f923a5989b5ee94ef02a12827412775bae)
|
|
|
|
|
|
|
|
|
|
|
| |
transaction)
log the right db_id
also log the client_id
Michael
(This used to be ctdb commit 48ac5c77698ab7a28d24629cc8a6985011c5d14d)
|
|
|
|
|
|
| |
Michael
(This used to be ctdb commit 2febdd23f754a2d4699bed36b941442ab362a376)
|
|
|
|
|
|
| |
Michael
(This used to be ctdb commit 3be446434adb0f3095ac0ef4b7c4a6258780b863)
|
|
|
|
|
|
| |
Michael
(This used to be ctdb commit 11fefd02e6c9531ffb28b9e6acaf42ba39757d87)
|
|
|
|
|
|
| |
Michael
(This used to be ctdb commit ab9657b5a66d5665e6c5fd1bf8eb4074a3bffeec)
|
|
|
|
|
|
| |
Michael
(This used to be ctdb commit 0fb9573d1c838b436ab9be83e197b68f35f94acb)
|
|
|
|
|
|
|
|
| |
When the operation completed / started successfully.
Michael
(This used to be ctdb commit 0df012d58eb83195ea0365be19e0566dbc394a66)
|
|
|
|
|
|
|
|
|
|
| |
performs the transaction
Otherwise a node can lock itself out, e.g. when a commit control times out...
Michael
(This used to be ctdb commit cb432e30351d5e5a41e98da3c7b1c2a4d400a3a2)
|
|
|
|
|
|
|
|
| |
time since the last recovery OR failover."
This reverts commit 3b0d44497800a16400d05a30bdaf6e6c285d4b36.
(This used to be ctdb commit cb36bbb5418290e8e5b770d2d836285b15da2a6f)
|
|
|
|
|
|
| |
since the last recovery OR failover.
(This used to be ctdb commit 3b0d44497800a16400d05a30bdaf6e6c285d4b36)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This aske the daemon wheter a transaction is currently active on a
given DB on that node. More precisely this asks for the transaction_active
flag in the ctdb_db_context that is set in the CTDB_TRANS2_COMMIT
control and cleared in the CTDB_TRANS2_ERROR or CTDB_TRANS2_FINISHED controls.
This will be useful for fixing race conditions in the transaction code.
Michael
(This used to be ctdb commit 8d430ae6968dfe566614379436fc3c56003fcd88)
|
|
|
|
|
|
|
|
| |
Spotted by Volker.
Michael
(This used to be ctdb commit 0a4d409baabf242a87c06293789d589c896b104c)
|
|
|
|
|
|
|
|
|
| |
so we can spot if there are leaks.
plug two leaks for filedescriptors related to when sending ARP fail
and one leak when we can not parse the local address during tcp connection establish
(This used to be ctdb commit ddd089810a14efe4be6e1ff3eccaa604e4913c9e)
|
|
|
|
|
|
| |
Michael
(This used to be ctdb commit c07d6d90f7afd19213ad44624c3e2b9c85f4eea8)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
| |
log the type of operation and the database name for all latencies higher
than a treshold
(This used to be ctdb commit 1d581dcd507e8e13d7ae085ff4d6a9f3e2aaeba5)
|
|
|
|
|
|
|
| |
the difference between a initial commit attempt and a retry, which
allows us to get the persistent updates counter right for retries
(This used to be ctdb commit 7f29c50ccbc7789bfbc20bcb4b65758af9ebe6c5)
|
|
|
|
| |
(This used to be ctdb commit 6915661a460cd589b441ac7cd8695f35c4e83113)
|
|
|
|
| |
(This used to be ctdb commit 0592ba2a4fbd1b3b7a6bd0780eadbd6d449baaad)
|