1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-04-19 21:02:17 +03:00

476 Commits

Author SHA1 Message Date
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
b054c7320c Assert that fragmen seqno is not undefined. Added debug crash points. 2018-07-16 16:50:49 +03:00
Teemu Ollakka
0efec1b8bd Added debug_crash() method to high priority service interface. 2018-07-16 12:45:53 +03:00
Teemu Ollakka
4418627f1b Fixed a condition to remove SR appliers during view change. 2018-07-16 11:15:24 +03:00
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
ddc6c6495b Made client_id, transaction_id constructors explicit. 2018-07-11 15:00:31 +03:00
Teemu Ollakka
d564a6f154 Included necessary files to get streaming_context.hpp compile
standalone.
2018-07-11 13:36:52 +03:00
Teemu Ollakka
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
Teemu Ollakka
d03736c4c3 Changed default streaming unit to bytes. 2018-07-10 14:36:17 +03:00
Teemu Ollakka
80ca03daaf Implemented SR transaction rollback. 2018-07-10 14:01:41 +03:00
Teemu Ollakka
e916453e6d Enabled Wnon-virtual-dtor 2018-07-09 23:03:44 +03:00
Teemu Ollakka
8c4a786f79 Collect and append SR commit keys. 2018-07-09 20:16:31 +03:00
Teemu Ollakka
6f68c70d37 Interface changes required to store and remove fragments from high
priority context.
2018-07-09 18:12:48 +03:00
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
8a1e76bcec Execution context switching for high priority service. 2018-07-09 11:35:20 +03:00
Teemu Ollakka
95dbab4c08 Made transaction streaming context private and provided accessor method. 2018-07-09 08:49:29 +03:00
Teemu Ollakka
7c424d8337 Fixes to local streaming replication processing. 2018-07-08 15:27:49 +03:00
Teemu Ollakka
2913aecebd Pass transaction id instead of client id to storage service append_fragment() 2018-07-07 21:34:58 +03:00
Teemu Ollakka
178f70d3be Fixed compilation error. 2018-07-07 18:08:30 +03:00
Teemu Ollakka
2ac13100f7 Refactored storage service out of client service interface. 2018-07-07 18:06:37 +03:00
Teemu Ollakka
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
Teemu Ollakka
af18a10a49 Removed is_autocommi() from client_service interface as it is not
quite useful as there might not be enough information for it
after the statement has been processed. Better to handle retrying
on DBMS side. Also removed after_statement_result enumeration and
return plain int from after_statement().
2018-07-06 19:48:48 +03:00
Teemu Ollakka
3ff322386c Added must_exit boolean flag to high_priority_service interface
This is needed to allow slave threads to exit processing loop
if requested by the DBMS.
2018-07-06 16:18:59 +03:00
Teemu Ollakka
e876418ed3 * Renamed client service rollback() to bf_rollback() to better
describe its purpose.
* Raise deadlock error for BF aborted transaction in after_statement()
  call if the error is not set yet.
2018-07-06 15:42:03 +03:00
Teemu Ollakka
5ef2c956a9 Added a separate call to notify the client thread about completion
of background rollback. The separate call is necessary as all of
the resources may not have been released before the execution
reaches after_rollback() call and background rollbacker needs
to notify the client thread after all is complete.
2018-07-05 17:42:38 +03:00
Teemu Ollakka
d80a69fe90 Defined log_state_change() interface in server_service.
The interface method can be used to notify the DBMS implementation
about state changes in well defined order. The call will be done
under server_state mutex protection.
2018-07-05 12:45:22 +03:00
Teemu Ollakka
fcefe9f03b Provide additional provider error status. Fixed IST handling. 2018-07-05 11:31:47 +03:00
Teemu Ollakka
b3de50fa05 Implemented convenience methods to desync/pause, resume/resync. 2018-07-04 18:12:42 +03:00
Teemu Ollakka
2668d85ebf Set state to s_must_abort when cert results conn failed. 2018-07-04 16:12:58 +03:00
Teemu Ollakka
a7f8728c12 After applying call, BF abort fixes
* Added after applying call for high priority threads in order to
  avoid client mode complexity in after_statement() call and
  make high prio transaction cleanup possible
* Mask connection failed error with deadlock error if provider
  returns connection failed and the transaction was BF aborted
2018-07-04 14:28:54 +03:00
Teemu Ollakka
4d59ade77b Always call provider bf_abort for active transactions
in transaction::bf_abort().

Check if the state is s_must_abort before changing the state to
s_must_abort when entering a critical section.
2018-07-04 08:39:20 +03:00
Teemu Ollakka
622b6583a2 Ignore TOI applying errors for now. 2018-07-03 21:29:35 +03:00
Teemu Ollakka
b9532e6497 Return provider status from set options. 2018-07-03 16:33:14 +03:00
Teemu Ollakka
4e8dfca3f1 Initial RSU implementation. 2018-07-03 12:37:22 +03:00
Teemu Ollakka
c552d944ed Deprecated sst_transferred(), always use sst_received() 2018-07-03 10:20:36 +03:00
Teemu Ollakka
e6d78c380d Pass ws_meta to high priority service apply_toi 2018-07-03 08:58:25 +03:00
Teemu Ollakka
3632e7823c Pass high_priority_service instead of void ptr for provider methods. 2018-07-03 07:48:35 +03:00
Teemu Ollakka
004244d203 Fixed dbsim SST issues. 2018-07-02 19:17:38 +03:00
Teemu Ollakka
635eaf4c29 Refactored high priority service out of client service. 2018-07-02 18:22:24 +03:00
Teemu Ollakka
658a84a7d4 Fixed BF abort in sync rollback mode.
* Pass condition variable for client_state
* Notify all cond waiters when changing the transcation status to
  aborted
* Wait for aborting transaction state aborted in before_command
2018-07-02 10:09:48 +03:00
Teemu Ollakka
db18e91c42 Implemented client last_written_gtid, sync_wait 2018-06-30 07:44:09 +03:00
Teemu Ollakka
3d2af88428 Propagate incoming address to provider. 2018-06-29 17:46:11 +03:00