1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-05 03:41:13 +03:00
Commit Graph

469 Commits

Author SHA1 Message Date
ad5d8ea066 Fixed typo for issue #68 2019-02-07 12:29:39 +02:00
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
e7f2dfdf93 Added .gitignore 2019-01-28 09:52:05 +02:00
1340442800 Helper script to run dbsim stress test with provider loaded 2019-01-25 14:50:44 +02:00
9a32c72b48 Fixed dbsim replaying to conform current implementation
Inherited db::replayer_service from db::high_priority_service
and overrode after_apply() and is_replaying() methods to match
current state of library implementation. Changed
db::client_service::replay() to use db::replayer_service instead
of db::high_priority_service().
2019-01-25 13:44:25 +02:00
fc5f59d27e Implemented dbsim high prio service log_dummy_write_set()
The empty implementation of log_dummy_write_set() in dbsim
high priority service implementation left unreleased commit
order critical section behind whenever remote write set failed
certification. Added calls to do empty commit to release the
critical section.

Other:

Implemented ostream operator<< for wsrep:🧵:id, and added
printout of owning thread into transaction debug output.
2019-01-25 12:18:46 +02:00
f30d9c06ce Enhanced dbsim to store view and position in storage engine
Mimic real DBMS implementation by storing view and position
into storage engine.
2019-01-25 12:18:46 +02:00
632f8c3b14 Fixed race condition in checking init_initialized on prim view
Flag init_initialized_ must be checked before changing the
state to s_initializing in on_primary_view() in order to avoid
race between main thread and applier thread. Otherwise it is
possible that main thread gains control after setting state
to initializing and changes the flag init_initialized_ to true
before the check is done in on_primary_view().
2019-01-25 12:18:46 +02:00
136767ae04 Added WSREP_LIB_STRICT_BUILD_FLAGS and WSREP_LIB_MAINTAINER_MODE to README.md 2019-01-24 18:15:13 +02:00
2e4cebb9e9 Added WSREP_LIB_MAINTAINER_MODE cmake option
In order to avoid excessive build failures because of compiler
warnings, added WSREP_LIB_MAINTAINER_MODE cmake option which
must be enabled explicity in order to enable -Werror build flag.
2019-01-24 17:57:23 +02:00
28e52c8412 Added runtime_error overload with const char* argument
Needed to add new overload to get code compiled with
AppleClang 10.0.
2019-01-23 11:41:34 +02:00
e61be45205 Added osx/xcode10.1 builds into build matrix 2019-01-23 11:41:18 +02:00
8e4777114b Update wsrep-API v26 to include enc signature fixes 2019-01-21 18:50:28 +02:00
6e2c70c226 codership/wsrep-lib#54 Fixed race in server disconnect
Convert streaming client to applier only if the server is not
in disconnected state. In disconnected state the appliers map
is supposed to be empty and will be reconstructed from fragment
storage when the server is connected back to cluster.
2019-01-21 17:00:08 +02:00
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
144d8c13c1 Relaxed server_state state transition sanity checks
In release build log a warning but continue with state transition
anyway. In debug build log warning and crash in assert.
2019-01-21 14:13:25 +02:00
76875c3be1 Allowed transition s_joined to s_donor 2019-01-21 14:13:25 +02:00
47263df442 Revert "codership/mariadb-wsrep#27 Galera cache encryption"
This reverts commit 7e9419e811.
2019-01-21 14:12:28 +02:00
476bcdb41e Revert "codership/mariadb-wsrep#27 Galera cache encryption fixup"
This reverts commit 043e8bc2ea.
2019-01-21 14:12:10 +02:00
043e8bc2ea codership/mariadb-wsrep#27 Galera cache encryption fixup
Fixup to enable/disable encryption on provider loading
2019-01-20 15:20:52 +02:00
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
ae734a33f8 Fixed compilation errors picked up by travis clang builds 2019-01-19 18:08:49 +02:00
869a706fa1 Added clang 3.8, 4.0, 5.0 and 7.0 build to travis build matrix 2019-01-19 18:08:10 +02:00
aeb5990642 Define undefined id and gtid as const static member variables.
Use default seqno and id constructors in default gtid ctor
instead of calls to static undefined to initialize.
2019-01-18 23:57:24 +02: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
17fc8c16de Turn "Enabling/Disabling streaming" into debug messages 2019-01-15 11:05:07 +01:00
1e9325197a Turn "Could not find applier context" into debug message
Remove warning "Could not find applier context" when no applier
context is found while applying rollback fragment.
2019-01-15 10:57:39 +01:00
1402cb3701 Added debug sync point before entering commit order 2019-01-11 18:30:30 +02:00
fccdad6ee9 Changed certification to happen in before_prepare()
Certification for commit fragments was changed to happen in
before_prepare in order to make GTID available for storage
engines in prepare phase.

Removed unused file src/wsrep-lib_test.cpp
2019-01-11 18:30:30 +02:00
a3a632cafe Added method to check if provider is loaded 2019-01-10 10:04:58 +01:00
4ac15e4349 Fix attempt to replicate empty fragments
* Adds method wsrep::transaction::streaming_step() so that there is a
  single place where streaming context unit counter is udpated.
  The method also checks that some data has been generated before
  attempting fragment replication.
* Emit a warning if there is an attempt to replicate a fragment and
  there is no data to replicate.
2019-01-07 16:33:32 +01:00
a9e2fdccfc Disable streaming on client_state::close() 2019-01-03 12:18:34 +01:00
0441746368 codership/wsrep-lib#44 Provider name, version and vendor getters
Added methods to get provider name, version and vendor strings
into wsrep::provider interface. Implementations for v26 and mock
providers.
2019-01-02 12:11:26 +02:00
cc67313515 Check if client was interrupted before fragment replication 2018-12-24 09:25:21 +01:00
653d2526eb codership/wsrep-lib#34 Changed flow of control in sst_received()
Instead of handling error case at the beginning, execute the middle
of method body in case of success, leaving only single call to
provider().sst_received() at the end.
2018-12-21 15:11:41 +02:00
4f88e9aea6 codership/wsrep-lib#34 Fixed non-debug compilation error 2018-12-20 19:35:31 +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
e9bb552096 codership/wsrep-lib#34 Provided a method to interrupt state waiters
Intruduced server_state::interrupt_state_waiters() to interrupt
all waiters inside server_state::wait_until_state(). This mechanism
is needed when an error is encountered during state change processing
and waiting threads may need to be interrupted to check and handle
the error condition.

Made server_state::wait_until_state() to throw exception if the
wait was interrupted and the new server state is either disconnecting
or disconnected, which usually indicates error condition.
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
ae0109f9b3 codership/wsrep-lib#34 Refactored view handling
Extracted on_primary_view(), on_non_primary_view() out of on_view().
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