1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-20 01:03:16 +03:00
Commit Graph

380 Commits

Author SHA1 Message Date
21781f6644 Improved SST diagnostic logging 2018-12-06 23:26:19 +02:00
0f77323d0e Refs codership/wsrep-lib#18 Don't recover view from state if SST failed.
It is pointless and most likely will result in an unnecessary error
message logged.
2018-12-06 23:26:19 +02:00
cb93aaa77b Lost e_error_during_commit if fragment size exceeds maximum size
If the size of a SR fragment exceeds the maximum size that the
replication provider allows us to replicate, then we are expected to
set the client error code to e_error_during_commit.
However, client_state::after_statement() unconditionally overrides it
to error e_deadlock_error.
Fixes client_state::after_statement() so that it overrided the error
only if noerror has been set yet.
2018-12-05 16:47:56 +01:00
8f490d431a Undefined server id in convert_streaming_client_to_applier()
Method wsrep::server_state::convert_streaming_client_to_applier() may
insert an entry in streaming_appliers_ map which contains undefined
server_id. This happens if the method is called while in non-primary
state, and server_state::id_ is undefined.
The fix is to use the server_id which is recorded in client's
tansaction object.
2018-12-03 22:36:24 +01:00
fd07ff12e4 Refs codership/wsrep-API#21 added support for the IMPLICIT_DEPS WS flag 2018-11-28 18:07:08 +01:00
8ffad51822 Fixed the definition of the encryption callback 2018-11-28 18:07:08 +01:00
cfcf34e70f codership/wsrep-lib#23 before_command() wait for ongoing rollbacks leaks
Storing information that background rollbacker in ongoing in client state has_rollback_
This can be used for detecting if there is ongoing background rollback,
and client should keep waiting in before_command() entry to avoid conflicts
in accessing client state during background rollbacking.

transaction::bf_abort() is modified to set has_rollback_ flag when
backgroung rollbacking has been assigned for the client

sync_rollback_complete() method has been modified to reset the backround
rollbacker flag
2018-11-27 12:26:14 +02:00
31f09ca4aa Refs codership/wsrep-lib#18 Fix compile warning
Fixes unused parameter `view` in server_state::go_final() when
compiled without assert()s.
2018-11-24 13:42:53 +01:00
3950ea3027 Refs codership/wsrep-lib#18 Small fixups
- fixed node ID assertion in on_connect() method,
   fixed "sanity checks" to allow reconnection to primary component
 - fixed code duplication in on_view() method
2018-11-23 23:27:09 +02:00
d95ec7ed99 Refs codership/wsrep-lib#18: Fixup to proper view from SST processing.
Added a call to log_view() to do the internal initializations that
need to be done on receiveing a new view. Note however that it is not
a view *event*. Here we only need to configure the application to
comply with a new state that it has received, so that it can go on
to apply replication events and catch up with the cluster.
2018-11-23 13:11:20 +02:00
a7a6441ee9 Avoid client_state locking while in storage service scope
This patch changes wsrep::transaction::after_rollback() and
wsrep::transaction::certify_fragment() so that no client state locking
is performed while in storage service scope.
The reason for this change is to not confuse the application as to
which client context locks/unlocks a mutex. More specifically, this
caused MariaDB's safe_mutex to report "Wrong usage of mutex" warnings
as the underlying THD context was switched while using storage service.
2018-11-21 10:46:01 +01:00
fb14883547 Recover current view from state after SST.
When member joins the group and needs to receive an SST it won't
receive the corresponding menbership view event because the SST
happens after the event and will already include the effects of
all events ordered before it. The view then must be recovered from
the received state.

Minor renames and cleanups.

References codership/wsrep-lib#18
2018-11-12 12:47:42 +02:00
ea9971d54b - Initialize member cluster ID only on connection to cluster and forget
it on disconnect.
 - Don't rely on own index from the view because the view may come from
   another member (IST/SST), instead always determine own index from own ID.

Refs codership/wsrep-lib#13
2018-11-09 00:42:05 +02:00
a942811ce7 User defined logger callback implementation
Added static wsrep::log::logger_fn() method to allow user to
provide logger callback.
2018-11-07 21:45:52 +02:00
d4efa598bb Added is_empty() method to transaction class
Method is_empty() can be determined if there have no been changes
to the transaction.
2018-10-26 11:48:59 +03:00
ed7c4d7410 Add prepare flag to wsrep::provider::flag 2018-10-24 11:35:28 +03:00
7c6ee3f61f In order to avoid potential deadlocks, release client_state lock when
calling server state methods which may acquire server_state mutex.

Fixed compilation errors in release mode.
2018-10-15 16:35:19 +03:00
c0c977f9ab Added GPLv2 licence and copyright headers. 2018-10-15 15:14:22 +03:00
5e5906d598 Prefixed cmake WITH_ definitions with WSREP_LIB_ to avoid collisions
with superproject definitions.

Avoid using client_service::do_2pc() in before_commit() to
determine if 2pc is actually happening, will use transaction
states to deduce that. client_service::do_2pc() should be deprecated.

Fixed a compiler warning in db_high_priority_service.cpp.
2018-10-12 16:04:52 +03:00
94174b06e6 codership/galera-bugs#165 Update to wsrep encryption API
Update wsrep-API/v26 submodule. Cleanup. Empty callback handler for encrypt.
2018-10-11 20:40:13 +03:00
31f244c3b3 Fixed compilation on Ubuntu 18.04 / GCC 7.3.0 2018-10-02 21:41:14 +03:00
5bf8ad1294 Close SR transactions when disconnecting from the group.
Moved SR fragment removal for total order BFd SR transactions
into after_rollback() call to avoid deadlocking while trying
to access storage before rolling back the transaction.
2018-07-19 15:13:27 +03:00
61e0e30687 Remove fragments in before rollback for streaming transactions
which got BF aborted in total order.
2018-07-19 13:52:12 +03:00
0410deee3a Fixes to streaming rollback.
* Check error code from fragment release
* Always call streaming rollback from must abort if the
  transaction is in executing phase. This is needed to ensure
  that rollback fragment replication happens before rollback starts
* Initiate streaming rollback from certify fragment if BF abort
  happens after fragment certification.
2018-07-19 01:11:02 +03:00
ca5c24655f Fixes to SR transaction processing
* Release server lock temporarily when BF aborting local SR
  transaction during view event processing
* Check transaction state for BF aborts in before_prepare() after
  the lock has acquired after fragment removal
* Send rollback fragment only from streaming_rollback()
2018-07-17 15:23:53 +03:00
b02200b1ef Fixes to streaming rollback
* Check fragment removal error code in prepare phase. It is possible
  that the transaction gets BF aborted during fragment removal.
* Mark fragment certified in certify_fragment() even if the provider
  returns cert failed error. With current wsrep-API error codes
  it may not be possible to distinquish certification failure
  and BF abort during fragment replication. This may also be a
  provider bug. As a result rollback fragment may sometimes be
  replicated when it would not be necessary.
2018-07-17 14:34:24 +03:00
b054c7320c Assert that fragmen seqno is not undefined. Added debug crash points. 2018-07-16 16:50:49 +03:00
0efec1b8bd Added debug_crash() method to high priority service interface. 2018-07-16 12:45:53 +03:00
4418627f1b Fixed a condition to remove SR appliers during view change. 2018-07-16 11:15:24 +03:00
9f153be277 Fixes to streaming rollback processing
* Count separately fragments certified and fragments stored in
  streaming context. Storing the fragment may ultimately fail
  due to BF abort even if the fragment was succesfully certified.
  Therefore we need to have separate counter for certified fragments
  to determine if the transaction is streaming and seqnos of fragments
  which have been succesfully stored.
* Provider release is called only after succesful fragment certification
  and fragment store.
* Fixed handling of write sets with rollback flag set in apply_write_set()
2018-07-16 10:07:46 +03:00
21ae2c849e Pass pointer to high priority service as a parameter for log_view()
The pointer will pass applier context to log_view(), where it
can be used for stable storage access.
2018-07-15 19:00:10 +03:00
86472ee420 Implemented SR transaction rollbacking during configuration changes.
SR tranasctions are BF aborted or rolled back on primary view
changes according to the following rules:
* Ongoing local SR transactions are BF aborted if the processing
  server is not found from the current view.
* All remote SR transactions whose origin server is not included in the
  current view are rolled back.
2018-07-14 16:11:13 +03:00
13487781d8 Total order BF abort client_state method to differentiate BF
aborts caused by conflicts between transactions and conflicts
between TOI operations and transactions.
2018-07-13 18:33:22 +03:00
4cfb9b6413 Introduced adopt_transaction() for storage_service interface
A SR transaction must be adopted by a storage service instance
running in background rollbacker thread while it is aborting a
SR transaction.
2018-07-13 15:36:27 +03:00
22d7a31d81 Fixes to SR rollback:
* Enable codepath to BF abort high priority SR applier
* Pass ws_handle, ws_meta to high priority service rollback
  call to allow total ordering of rollback process
2018-07-12 18:00:52 +03:00
3f4e5dea3b Revised logic to handle SR replaying
* Added server_id into transaction in order to be able to stop
  streaming applier during high priority BF abort
* Added missing commit fragment applying
* Don't clear fragments for replaying SR transaction
2018-07-12 13:36:45 +03:00
ddc6c6495b Made client_id, transaction_id constructors explicit. 2018-07-11 15:00:31 +03:00
3b9e9e0d0c SR Rollback handling fixes
* Handle BF rollback also in after_statement() call.
* Added missing after_apply() call when handling rollback fragment.
* Fixed state changes when rollback is starated during preparing state.
2018-07-11 11:39:55 +03:00
d03736c4c3 Changed default streaming unit to bytes. 2018-07-10 14:36:17 +03:00
80ca03daaf Implemented SR transaction rollback. 2018-07-10 14:01:41 +03:00
8c4a786f79 Collect and append SR commit keys. 2018-07-09 20:16:31 +03:00
6f68c70d37 Interface changes required to store and remove fragments from high
priority context.
2018-07-09 18:12:48 +03:00
958a916b25 * Don't set ordering meta data for replaying transaction
* Renamed transaction prepare_for_fragment_ordering() to
  prepare_for_ordering()
2018-07-09 13:23:16 +03:00
6aa6b6f50a Provider write set handle and meta data for high priority commit
The write set handle and meta data are needed for SR transactions
where the commit context is not known when the transaction starts.
The passed handle and meta data can be set through client_state
prepare_for_ordering() call before performing commit.
2018-07-09 13:02:13 +03:00
8a1e76bcec Execution context switching for high priority service. 2018-07-09 11:35:20 +03:00
95dbab4c08 Made transaction streaming context private and provided accessor method. 2018-07-09 08:49:29 +03:00
7c424d8337 Fixes to local streaming replication processing. 2018-07-08 15:27:49 +03:00
2913aecebd Pass transaction id instead of client id to storage service append_fragment() 2018-07-07 21:34:58 +03:00
2ac13100f7 Refactored storage service out of client service interface. 2018-07-07 18:06:37 +03:00
a8be09161c Replaced replicating mode with local.
The intended purpose for local mode was local storage access without
entering replication hooks. However, the same can be achieved with
high priority mode. Removed replicating mode and use local instead to
denote locally processing clients.
2018-07-07 12:01:14 +03:00