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
Daniele Sciascia
eac56f19e0 Remove dead code 2020-10-05 15:10:48 +02:00
Teemu Ollakka
1205fdbc84 Extend asan coverage to include all GCC compilers except 4.4 and 4.7. 2020-10-02 15:58:32 +03:00
Daniele Sciascia
3f1c3dc22d Make coverage work with out-of-source builds 2020-09-28 18:44:37 +02:00
Teemu Ollakka
96cd92164e Added gcc 10 build into travis configuration, fixed compilation errors. 2020-09-03 15:22:28 +03:00
Teemu Ollakka
ae4e58ba03 Check existence if dl library.
All platforms do not have dl library, but dlopen() and friends
are included in libc.

Check existence of dl lib and store into WSREP_LIB_LIBDL if found.
2020-07-31 11:13:15 +03:00
Teemu Ollakka
3e5a28df32 codership/wsrep-lib#135 Fix wrong assertion in before_command().
An assertion

  `server_state_.rollback_mode() == wsrep::server_state::rm_async`

fired in `client_state::before_command()` if a BF abort happened
between calls to wait_rollback_complete_and_acquire_ownership()
and before_command().

This commit adds a test to reproduce the assertion and verify
the correct behavior, as well as removes the incorrect assertion
to fix the issue.
2020-07-24 10:46:48 +03:00
Teemu Ollakka
8ba574f7bf Make sure that NDEBUG is defined in release builds. 2020-07-23 10:12:30 +03:00
Alexey Yurchenko
daae4a9c35 Some methods in wsrep-lib still hide/ignore return codes from provider
which complicates diagnostics and debugging.

Don't ignore provider return codes and more verbose error logging for
sst_sent(), sst_received(), set_encryption_key() methods

Refs codership/wsrep-lib#127
2020-07-14 12:50:04 +03:00
Teemu Ollakka
593f737605 Configurable data payload size for dbsim. 2020-07-02 17:39:21 +03:00
mkaruza
94f5696010 Provide logger callback for wsrep_load 2020-04-17 17:24:23 +02:00
mkaruza
d0255569b0 Variable desynced_on_pause getter 2020-04-03 10:10:29 +02:00
Alexey Yurchenko
0cec027030 Refs codership/wsrep-lib#124 32-bit compilation fix 2020-03-20 13:52:50 +00:00
Teemu Ollakka
dcdd7435bd Added sync-wait option to dbsim. 2020-01-15 11:49:24 +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
Teemu Ollakka
76f7249b8d Incorrect assertion and state handling in after_replay().
If the transaction fails during replay because of certification
failure, the provider will return control to applier without
terminating the transaction and transaction remains in
s_replaying.

Fixed transaction::after_statement() to handle the state changes
correctly if certification failure is returned from replay.
Replaying was extracted to separate private method from
after_statement(). Removed transaction::after_replay() as it
seems now unnecessary and it bypassed state change sanity checks.

Allowed replaying -> committed transaction transition to handle
the situation where DBMS allocates a new context and client_state
to do the replay.
2019-12-28 12:28:38 +02:00
Teemu Ollakka
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
Teemu Ollakka
29e061116a Fixed transaction_xa_applying unit test.
Adjusted transaction_xa_applying unit test to change in
applying_client_fixture. The fixture does not start transaction
and the transaction needs to be started in test explicitly.
2019-12-08 12:52:36 +02:00
Leandro Pacheco
57523eea75 enter_toi polling fix 2019-12-08 12:52:36 +02:00
Teemu Ollakka
8e37727a27 Removed extra line. 2019-12-08 12:52:36 +02:00
Teemu Ollakka
7d8583983f Fixes to review comments
- Increased loop sleep in poll_enter_toi()
- Fixed typos in comments
- Got rid of unnecessary ostringstreams
2019-12-08 12:52:36 +02:00
Teemu Ollakka
3fd20c4e4d Fixed compilation for gcc 4.4 2019-12-08 12:52:36 +02:00
Leandro Pacheco
043ff7a7e9 remove has_error arg from begin_nbo_phase_two 2019-12-08 12:52:36 +02:00
Leandro Pacheco
b64fbe8fbc fix compilation of unit tests 2019-12-08 12:52:36 +02:00
Leandro Pacheco
3389b7ad3c better error handling for NBO failures
when losing error voting:
- if NBO has failed locally (DBMS side), don't override original DBMS
  error so it gets reported to the client
- otherwise, report "query interrupted" instead of "error during commit"
2019-12-08 12:52:36 +02:00
Leandro Pacheco
b63e753aec removed unnecessary leave_toi and related TODO 2019-12-08 12:52:36 +02:00
Leandro Pacheco
f27f549479 poll_enter_toi timeout handlign 2019-12-08 12:52:36 +02:00
Teemu Ollakka
64fda07e91 Fixed NBO unit tests. 2019-12-08 12:52:36 +02:00
Leandro Pacheco
e0f9550967 handle certification error explicitly when entering TOI 2019-12-08 12:52:36 +02:00
Teemu Ollakka
922ce579c7 Clear NBO meta on failure, reset current error status after command. 2019-12-08 12:52:36 +02:00
Teemu Ollakka
086c466637 - Added wait-until parameter for begin_nbo_phase_two().
- Retry enter_toi() in poll_enter_toi() also for error_connection_failed
  which means that the connectivity to the cluster has been lost,
  a.k.a non-prim.
2019-12-08 12:52:36 +02:00
Teemu Ollakka
750052b640 Fixed timeout condition in poll_enter_toi() 2019-12-08 12:52:36 +02:00
Teemu Ollakka
3a1b194741 Pass certification keys also for NBO end.
Certification keys are needed for NBO end to resolve dependencies
for the write sets which follow NBO end. Without keys the following
write sets do not detect dependency to NBO event and may start applying
too early.
2019-12-08 12:52:36 +02:00
Teemu Ollakka
58cea10577 Release TOI critical section in poll_enter_toi() in case of error. 2019-12-08 12:52:36 +02:00
Teemu Ollakka
4ff55088b1 Fix NBO error handling
- Set both current error and current error status if provider enter_toi()
  or leave_toi() fails.
- Leave NBO mode if TOI cannot be entered in begin_nbo_phase_two().
2019-12-08 12:52:36 +02:00
Teemu Ollakka
e700ce8c79 Added short sleep between calls to enter_toi(). 2019-12-08 12:52:36 +02:00
Teemu Ollakka
aaa92e130b Made gcc 4.4 work. 2019-12-08 12:52:36 +02:00
Teemu Ollakka
b05abb005f Chrono definitions to work around g++ 4.4 C++11 incompatibilities. 2019-12-08 12:52:36 +02:00
Teemu Ollakka
55fdbb7a05 Added timeout option to enter_toi_local() and begin_nbo_phase_one()
If timeout option is give, enter_toi_local() and begin_nbo_phase_one()
retry provider::enter_toi() as long as return status indicates
certification failure, given timeout expires or the client is interrupted.
2019-12-08 12:52:36 +02:00
Teemu Ollakka
b46f89f4ce Fixed unused variable warning. 2019-12-08 12:52:36 +02:00
Teemu Ollakka
0683654e53 Include <chrono> to check if it compiles with all required compilers. 2019-12-08 12:52:36 +02:00
Leandro Pacheco
594e34052d handle nbo apply eror
also, remove outdated comment
2019-12-08 12:52:36 +02:00
Leandro Pacheco
5298d2340e error parameter to nbo calls and m_undefined for toi_mode
toi_mode is set only when actually inside phase one and two.
In between it goes back to m_undefined.
2019-12-08 12:52:36 +02:00
Teemu Ollakka
0b12869715 NBO begin error handling, unit test 2019-12-08 12:52:36 +02:00
Teemu Ollakka
e9bd950ee6 Fixed nbo_meta handling, release commit order for NBO begin. 2019-12-08 12:52:36 +02:00
Teemu Ollakka
c7a25b15db Ingnore NBO end event in applier, it will be handled via local TOI 2019-12-08 12:52:36 +02:00
Teemu Ollakka
24ad144db3 - Remove unneeded keys from nbo phase two begin.
- Save nbo meta for phase two
- Assign trx_meta in mutable_ws_meta
2019-12-08 12:52:36 +02:00
Teemu Ollakka
6291f1bf16 Squashed memory leaks to get clean test run with ASAN enabled. 2019-12-08 12:52:36 +02:00
Teemu Ollakka
85a03394cc NBO applying
- High priority interface method to apply NBO begin, separate from
  apply_toi() in order to avoid implementation to force interpreting
  ws_meta flags.
- Method to put client_state into NBO mode when applying NBO begin.
  The client_state will process in m_local mode.
- Unit tests for applying NBO
2019-12-08 12:52:36 +02:00
Teemu Ollakka
1267e29b8f Implementation of client_state NBO operations.
- Implemented calls to enter and leave NBO phase one and two
- Extended client_state mode checking to include m_nbo
- Changed client_state state and mode change sanity checks to
  print a warning and assert() instead of throwing exceptions
  to be more graceful in release builds.
2019-12-08 12:52:36 +02:00
Teemu Ollakka
45c64735d6 Added unit test for TOI operations 2019-12-08 12:52:36 +02:00