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
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
593f737605 Configurable data payload size for dbsim. 2020-07-02 17:39:21 +03:00
94f5696010 Provide logger callback for wsrep_load 2020-04-17 17:24:23 +02:00
d0255569b0 Variable desynced_on_pause getter 2020-04-03 10:10:29 +02:00
0cec027030 Refs codership/wsrep-lib#124 32-bit compilation fix 2020-03-20 13:52:50 +00:00
dcdd7435bd Added sync-wait option to dbsim. 2020-01-15 11:49:24 +02:00
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
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
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
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
57523eea75 enter_toi polling fix 2019-12-08 12:52:36 +02:00
8e37727a27 Removed extra line. 2019-12-08 12:52:36 +02:00
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
3fd20c4e4d Fixed compilation for gcc 4.4 2019-12-08 12:52:36 +02:00
043ff7a7e9 remove has_error arg from begin_nbo_phase_two 2019-12-08 12:52:36 +02:00
b64fbe8fbc fix compilation of unit tests 2019-12-08 12:52:36 +02:00
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
b63e753aec removed unnecessary leave_toi and related TODO 2019-12-08 12:52:36 +02:00
f27f549479 poll_enter_toi timeout handlign 2019-12-08 12:52:36 +02:00
64fda07e91 Fixed NBO unit tests. 2019-12-08 12:52:36 +02:00
e0f9550967 handle certification error explicitly when entering TOI 2019-12-08 12:52:36 +02:00
922ce579c7 Clear NBO meta on failure, reset current error status after command. 2019-12-08 12:52:36 +02:00
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
750052b640 Fixed timeout condition in poll_enter_toi() 2019-12-08 12:52:36 +02:00
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
58cea10577 Release TOI critical section in poll_enter_toi() in case of error. 2019-12-08 12:52:36 +02:00
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
e700ce8c79 Added short sleep between calls to enter_toi(). 2019-12-08 12:52:36 +02:00
aaa92e130b Made gcc 4.4 work. 2019-12-08 12:52:36 +02:00
b05abb005f Chrono definitions to work around g++ 4.4 C++11 incompatibilities. 2019-12-08 12:52:36 +02:00
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
b46f89f4ce Fixed unused variable warning. 2019-12-08 12:52:36 +02:00
0683654e53 Include <chrono> to check if it compiles with all required compilers. 2019-12-08 12:52:36 +02:00
594e34052d handle nbo apply eror
also, remove outdated comment
2019-12-08 12:52:36 +02:00
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
0b12869715 NBO begin error handling, unit test 2019-12-08 12:52:36 +02:00
e9bd950ee6 Fixed nbo_meta handling, release commit order for NBO begin. 2019-12-08 12:52:36 +02:00
c7a25b15db Ingnore NBO end event in applier, it will be handled via local TOI 2019-12-08 12:52:36 +02:00
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
6291f1bf16 Squashed memory leaks to get clean test run with ASAN enabled. 2019-12-08 12:52:36 +02:00
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
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
45c64735d6 Added unit test for TOI operations 2019-12-08 12:52:36 +02:00
9b25cebdf1 codership/wsrep-lib#117 Fixed empty vector access.
Access to empty vector by using operator[] may cause stdlib++
assertions to fail. Replaced the vector data access to use data()
method which is valid operation even if the vector is empty.

Added unit test to reproduce assertion with empty mutable_buffer access.

Added -D_GLIBCXX_ASSERTIONS preprocessor option to debug builds
to catch standard library misuse.

Added gcc 8 and gcc9 into travis build matrix.
2019-12-05 14:27:35 +02:00
c9513bd2e4 Fixed compilation errors with GCC 4.7
- Do not use [[noreturn]] with GCC older than 4.8.
- Use if/else instead of ternary operator in transaction
  commit_or_rollback_by_xid() to avoid debug build failure with
  GCC 4.7.
2019-10-28 17:22:09 +02:00
5ca8e4780e Added GCC 4.7 to travis build matrix. 2019-10-28 17:22:00 +02:00
66ee7bed1b Add type wsrep::xid
Create type `wsrep::xid`, and change all signatures that take
`std::string xid` to take `wsrep::xid xid`.
2019-10-18 09:36:18 +02:00
682d1b2034 Split commit_or_rollback_by_xid() in two methods
Split `client_state::commit_or_rollback_by_xid()` into
`client_state::commit_by_xid()` and `client_state::rollback_by_xid()`.
2019-10-16 11:42:44 +02:00
725f148ddb Remove query() method from wsrep::client_service interface 2019-10-16 10:16:39 +02:00
5d18ce3e75 Minimize client_service interface for XA
Remove methods `is_xa()`, `is_xa_prepare()`, and `xid()` from
client_service interface. Instead, transactions are explicitly
assigned their xid, through at start of XA.
2019-10-16 10:16:39 +02:00