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
8c2daa7e3d Handle BF abort during fragment removal
Fragment removal for SR transaction is done in transaction context
to make it atomic. However, this means that if the BF abort arrives
during fragment removal, the transaction may be rolled back inside
client_service::remove_fragments(), and client_state::after_prepare()
is left in aborted state. This case was not handled in the
post condition checks of after_prepare().

Fixed assertion in after_prepare() and implemented unit test.
2019-02-15 12:09:49 +02:00
Teemu Ollakka
9c387ef82f Count fragments certified for a statement.
The counter counts fragments which were succesfully certified since
the object construction or last after_statement() call.
2019-02-15 09:50:37 +02:00
Teemu Ollakka
af8383daf0 C++11 checks in CMakeLists.txt, added atomic.hpp
Check if the superproject has already enabled C++11 before enabling
it in CMakeLists.txt.

Added utility file atomic.hpp to select the correct atomics header
to work around issues with ancient GCC 4.4.
2019-02-13 13:05:45 +02:00
mkaruza
be98517cb3 Debug log level implementation
Debug log will now filter output based on debug level that is enabled.
2019-02-13 13:05:45 +02:00
Teemu Ollakka
510c7f767f Deal with backwards compatibility in sst_received()
Earlier versions of cluster software may not support storing
the view info into stable storage. In order to work around this
during rolling upgrade, skip sanity checks for recovered view
if the view state_id ID is undefined.
2019-02-13 08:54:10 +02:00
Teemu Ollakka
20b52ff1dd Allow direct manipulation of streaming context parameters.
Added a method to change streaming context fragment unit and
size. The method has a side effect of resetting unit counter.
2019-02-11 16:50:08 +02:00
Shahriyar Rzayev
4eb6074e67 codership/wsrep-lib#71 to make output cleaner with additional space 2019-02-08 14:04:04 +04:00
Shahriyar Rzayev
ad5d8ea066 Fixed typo for issue #68 2019-02-07 12:29:39 +02: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
e7f2dfdf93 Added .gitignore 2019-01-28 09:52:05 +02:00
Teemu Ollakka
1340442800 Helper script to run dbsim stress test with provider loaded 2019-01-25 14:50:44 +02:00
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
136767ae04 Added WSREP_LIB_STRICT_BUILD_FLAGS and WSREP_LIB_MAINTAINER_MODE to README.md 2019-01-24 18:15:13 +02:00
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
e61be45205 Added osx/xcode10.1 builds into build matrix 2019-01-23 11:41:18 +02:00
Teemu Ollakka
8e4777114b Update wsrep-API v26 to include enc signature fixes 2019-01-21 18:50:28 +02:00
Teemu Ollakka
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
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
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
mkaruza
76875c3be1 Allowed transition s_joined to s_donor 2019-01-21 14:13:25 +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
Teemu Ollakka
476bcdb41e Revert "codership/mariadb-wsrep#27 Galera cache encryption fixup"
This reverts commit 043e8bc2ea782b973a5982a8980473cd51e4c574.
2019-01-21 14:12:10 +02:00
Alexey Yurchenko
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
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
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
Teemu Ollakka
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
Teemu Ollakka
55f6c63328 codership/wsrep-lib#52 Removed client_service do_2pc() 2019-01-16 19:33:32 +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
Daniele Sciascia
17fc8c16de Turn "Enabling/Disabling streaming" into debug messages 2019-01-15 11:05:07 +01:00
Daniele Sciascia
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
Teemu Ollakka
1402cb3701 Added debug sync point before entering commit order 2019-01-11 18:30:30 +02:00
Teemu Ollakka
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
mkaruza
a3a632cafe Added method to check if provider is loaded 2019-01-10 10:04:58 +01:00
Daniele Sciascia
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
Daniele Sciascia
a9e2fdccfc Disable streaming on client_state::close() 2019-01-03 12:18:34 +01:00
Teemu Ollakka
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
Daniele Sciascia
cc67313515 Check if client was interrupted before fragment replication 2018-12-24 09:25:21 +01:00
Teemu Ollakka
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
Teemu Ollakka
4f88e9aea6 codership/wsrep-lib#34 Fixed non-debug compilation error 2018-12-20 19:35:31 +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
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
Teemu Ollakka
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
Teemu Ollakka
76335a3042 Added test case for desync-pause-resume-resync. 2018-12-20 19:35:31 +02:00
Teemu Ollakka
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
Teemu Ollakka
e5e5d409ed Test case for init first succesfull SST. 2018-12-20 19:35:31 +02:00