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

41 Commits

Author SHA1 Message Date
Teemu Ollakka
d2f27babd6 Add lock argument to server_service::background_rollback()
This is to allow implementation to temporarily release the
lock if needed.
2023-04-16 19:12:26 +03:00
Teemu Ollakka
7843345a19 Extracted duplicate logic into return_from_donor_state
The condition to skip changing to `s_joined` for all codepaths
which return from donor state. Extracted the logic into separate
method.

Commented start_sst_action in mock_server_service.
2023-02-28 16:20:18 +02:00
Teemu Ollakka
5a943b66a7 Fix assertion unallowed state transition: connected -> joined
When the donor lost its donor state during SST due to cluster
partitioning, the state was erranously changed to `s_joined`
in `start_sst()` and `sst_sent()`, which caused assertion failures
in state checking.

Fixed by changing state to `s_joined` only if donor is still in
`s_donor` state.
2023-02-28 12:13:00 +02:00
Teemu Ollakka
3b3429d8df Work around GCC 12 warning of uninitialized use
Use pointers to pass state objects to service constructors
to work around GCC 12 warning

  error: member ‘wsrep::mock_storage_service::client_state_’
  is used uninitialized
2023-02-27 13:32:55 +02:00
Daniele Sciascia
a17b65a25f Set server position after local certification failure
After a local certification failure, commit order is released without
the setting the current position in DBMS. Which results in diverging
positions between provider and DBMS, if clean shutdown happens right
after local certification failure.
This patch add method set_position() to server_service class. So that
wsrep-lib can instruct DBMS to set the current position after local
certification failure releases commit order.
2020-01-07 11:20:21 +01:00
Alexey Yurchenko
0f676bd893 codership/wsrep-lib#104 Error voting support
- populate and pass real error description buffer to provider in case
   of applying error
 - return 0 from server_state::on_apply() if error voting confirmed
   consistency
 - remove fragments and rollback after fragment applying failure
 - always release streaming applier on commit or rollback
2019-07-15 03:48:55 +03:00
mkaruza
e7d72ae7f6 codership/mariadb-wsrep#27 Galera cache encryption
* Created interface class for encryption support
* Implemented function for setting enc key to provider, callback function for encryption/decryption
2019-02-01 16:57:34 +01:00
Teemu Ollakka
a6b38d2428 codership/wsrep-lib#54 Service call to recover streaming appliers
Introduced server_service recover_streaming_appliers() interface
call which will be called in total order whenever streaming appliers
must be recovered. The call comes with two overloads, one which
can be called from client context (e.g. after SST has been received)
and the other from high priority context (e.g. view event handling).

The client context overload should be eventually be deprecated once
there is a mechanism to make provider signal that it has joined to
the cluster and will start applying events.
2019-01-21 17:00:08 +02:00
Teemu Ollakka
47263df442 Revert "codership/mariadb-wsrep#27 Galera cache encryption"
This reverts commit 7e9419e8111c3ca37d5e484282fe11a690eb2c6a.
2019-01-21 14:12:28 +02:00
mkaruza
7e9419e811 codership/mariadb-wsrep#27 Galera cache encryption
* Implemented encryption callback and enc_set_key
* Added pure virtual functions for encryption functionality
* Set enc key if provider was not loaded on time
2019-01-19 23:58:20 +01:00
Teemu Ollakka
ae734a33f8 Fixed compilation errors picked up by travis clang builds 2019-01-19 18:08:49 +02:00
Teemu Ollakka
89b3561ad8 Read recovered position from sst_received() after initialization
In general the position where the storage recovers after a SST
cannot be known untile the recovery process is over. This in turn
means that the position cannot be known when the server_state
sst_received() method is called. Worked around the problem by
introducing get_position() method into server service which
can be used to get the position from stable storage after SST
has completed and the state has been recovered.
2019-01-15 12:35:06 +02:00
Teemu Ollakka
ba02e7525b codership/wsrep-lib#34 Unit tests for initialization errors
Unit test for server initialization state errors.
2018-12-20 19:35:31 +02:00
Teemu Ollakka
e81c66cd59 Fixed assertion on server_state connected - disconnecting transition
Transition from server_state connected state to disconnecting must
be allowed to deal with errors during server startup.

Added SST first test cases for server_state transitions:
* Successful join via SST
* Error in connect state
* Error in joiner state
2018-12-20 19:35:31 +02:00
Alexey Yurchenko
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
Alexey Yurchenko
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
Teemu Ollakka
b322a3a45c Cleaned up obsolete methods 2018-10-24 19:15:52 +03:00
Teemu Ollakka
cb1ca4e66e Rollback and release streaming appliers in unit tests
Unit tests which cause streaming rollback leaked memory because
the streaming applier handle which was created for rollback
fragment handling was not released. Roll back a streaming transaction
and release applier handle appropriately in corresponding tests.
2018-10-17 12:51:01 +03:00
Teemu Ollakka
a9abb3a80a Extracted mock_server_service out of mock_server_state. 2018-10-17 12:07:41 +03:00
Teemu Ollakka
c0c977f9ab Added GPLv2 licence and copyright headers. 2018-10-15 15:14:22 +03:00
Alexey Yurchenko
31f244c3b3 Fixed compilation on Ubuntu 18.04 / GCC 7.3.0 2018-10-02 21:41:14 +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
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
ddc6c6495b Made client_id, transaction_id constructors explicit. 2018-07-11 15:00:31 +03:00
Teemu Ollakka
8a1e76bcec Execution context switching for high priority service. 2018-07-09 11:35:20 +03:00
Teemu Ollakka
2ac13100f7 Refactored storage service out of client service interface. 2018-07-07 18:06:37 +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
4e8dfca3f1 Initial RSU implementation. 2018-07-03 12:37:22 +03:00
Teemu Ollakka
635eaf4c29 Refactored high priority service out of client service. 2018-07-02 18:22:24 +03:00
Teemu Ollakka
3d2af88428 Propagate incoming address to provider. 2018-06-29 17:46:11 +03:00
Teemu Ollakka
c35f59cb5b Deal with init before SST case. 2018-06-29 17:02:35 +03:00
Teemu Ollakka
0851970c53 Bootstrap server service, fixes to server state management
* Added bootstrap service call to do DBMS side bootstrap operations
  during the cluster bootstrap.
* Added last_committed_gtid() to provider interface
* Implemented wait_for_gtid() provider call
* Pass initial position to the server state
2018-06-29 11:54:33 +03:00
Teemu Ollakka
fd9cf87141 * Return provider status from provider connect
* Call to get server status variables along with provider variables
* Deal with intermediate non-prims
2018-06-27 15:36:52 +03:00
Teemu Ollakka
2a53198f5c Protocol version and connected gtid
* Propagate server max protocol version to provider init options
* Store gtid from connected call to make cluster id and the connect
  position available
2018-06-26 11:34:05 +03:00
Teemu Ollakka
ccf5c08c35 * Removed client_context from server_service::log_view() params
* Call log_view() from server_state view handler
2018-06-26 08:04:05 +03:00
Teemu Ollakka
1f6a6db1e9 * Fixes to SST time server state management
* Logging tweaks
* Boolean to tune behavior on exception
2018-06-22 13:03:12 +03:00
Teemu Ollakka
bf7dad6815 Added open(), close(), cleanup() methods to client_state.
Depending on the DBMS client session allocation strategy the
client id may or may not be available when the client_session
is constructed, therefore there should be a method to assign
an id after construction. Close/cleanup methods were added to
clean up open transactions appropriately.
2018-06-20 10:07:55 +03:00
Teemu Ollakka
cf231bdf2d Refactored server_service out of server_state. 2018-06-18 17:45:24 +03:00
Teemu Ollakka
ef5751943d Refactored most of the server_state interface into server_service
abstract interface.
2018-06-18 16:52:41 +03:00
Teemu Ollakka
03043d3f25 Removing client_state dependency from client_service. 2018-06-18 10:21:02 +03:00
Teemu Ollakka
ef4baa9f9d Renamed server_context to server_state. 2018-06-17 10:07:48 +03:00