1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-22 23:21:53 +03:00
Commit Graph

38 Commits

Author SHA1 Message Date
90157ed1b0 Allow concurrent server_state disconnect operations.
Shutting down the provider may cause replication/appling failures, which
may further result to disconnect calls from failing operations.
Allow concurrent disconnect requests to deal with such a situations.
2019-12-08 13:42:11 +02:00
477a71dd46 Updated wsrep-API, added -Wconversion to compiler flags, fixed errors. 2019-10-11 09:56:07 +03:00
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
55f6c63328 codership/wsrep-lib#52 Removed client_service do_2pc() 2019-01-16 19:33:32 +02:00
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
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
ac5a4cde0d codership/wsrep-lib#34 Fixed init first IST processing
Init first join crashed in

  server: s1 unallowed state transition: joined -> joined

This was due to missing state check for state in on_primary_view()
before changing to joined state. Added appropriate check.

Implemented unit tests for simple IST scenarios.
2018-12-20 19:35:31 +02:00
76335a3042 Added test case for desync-pause-resume-resync. 2018-12-20 19:35:31 +02:00
728eaa80b5 Added test cases for donor transitions.
Replaced all references to provider_ in server_state methods to
provider() call which is virtual and can be overridden by test classes.
Provider pointer may not be initialized during unit tests yet.
2018-12-20 19:35:31 +02:00
e5e5d409ed Test case for init first succesfull SST. 2018-12-20 19:35:31 +02:00
a4ea80e11a Added test cases for error/shutdown in joined and donor states. 2018-12-20 19:35:31 +02:00
7cd0656990 Allow server_state joiner - disconnecting transition.
Transition joiner - disconnecting may happen when the joiner failed
to receive SST succesfully. Because the system is at undefined state
at this point, skip most of the processing in sst_received()
and return control to caller after notifying the provider about
failure.
2018-12-20 19:35:31 +02:00
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
1776537765 codership/wsrep-lib#34 Handle sync-disconnected-sync for init first
Handle init first case where state is cycled from synced to
disconnected and back synced without SST.
2018-12-20 19:35:31 +02:00
76424ad515 codership/wsrep-lib#34 Unit test for sync-disconnect-sync
Added unit test for sync-disconnect-sync transition without SST.
2018-12-20 19:35:31 +02:00
bf83907f38 codership/wsrep-lib#34 Moved cluster_id, bootstrap_view into base fixture
Made cluster_id, bootstrap_view members of server_fixture_base and
initialize them in serveri_fixture_base constructor to reduce typing
in test cases.
2018-12-20 19:35:31 +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
a9abb3a80a Extracted mock_server_service out of mock_server_state. 2018-10-17 12:07:41 +03:00
c0c977f9ab Added GPLv2 licence and copyright headers. 2018-10-15 15:14:22 +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
ddc6c6495b Made client_id, transaction_id constructors explicit. 2018-07-11 15:00:31 +03:00
7c424d8337 Fixes to local streaming replication processing. 2018-07-08 15:27:49 +03:00
635eaf4c29 Refactored high priority service out of client service. 2018-07-02 18:22:24 +03:00
c35f59cb5b Deal with init before SST case. 2018-06-29 17:02:35 +03:00
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
d3821d88a5 Partial implementation of methods needed for SST.
* server_state desync()/resync() and pause()/resume()
* Fixes to server_state state machine
2018-06-24 14:35:47 +03:00
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
03043d3f25 Removing client_state dependency from client_service. 2018-06-18 10:21:02 +03:00
ef4baa9f9d Renamed server_context to server_state. 2018-06-17 10:07:48 +03:00
790c2bec4e Renamed transcation_context to transaction 2018-06-17 10:04:00 +03:00
dd28b173ab Renamed client_context to client_state. 2018-06-17 10:00:13 +03:00
47cb8e604c Renamed client context m_applier to m_high_priority 2018-06-16 15:08:31 +03:00
256000f934 Refactored client_service interface out of client_context 2018-06-14 19:44:38 +03:00
ca6286d8b2 Use provider for replaying in mock client_context instead of
calling server context apply directly.
2018-06-14 12:41:34 +03:00
a8ab9c6dbd SR applying implementation, unit tests. 2018-06-14 11:14:40 +03:00
39c9ef8a63 Tests for transaction context, server context state strings. 2018-06-13 17:24:37 +03:00
461247adc1 Renamed unit test doubles 2018-06-13 11:23:48 +03:00
174ecfe578 Moved tests under separate directory. 2018-06-12 18:17:32 +03:00