1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-21 12:22:06 +03:00

79 Commits

Author SHA1 Message Date
b3f0e05da4 Pass victim context for provider on BF abort
This change is needed for custom provider implementations to
have a way to access the victim in the application context.

Helper interface operation_context to pass caller context for
service/provider callbacks in more type safe way.
2022-05-25 12:50:42 +03:00
7498ed424a Add provider position field to ws_meta and view
Provider position is needed in coordinated recovery
between application and provider. Pass the position
info from provider to application to allow making
it durable.
2022-04-01 12:24:05 +03:00
51e162d6f4 Reset TOI meta after releasing total order in provider
This is to keep the TOI meta available in case the provider
implementation needs it.
2022-03-19 15:54:12 +02:00
14b3612a30 Initial allowlist support 2021-12-06 14:23:40 +01:00
9318a50d18 Wsrep TLS service
This commit defines a TLS service interface. If the implementation is
provided by the application when the provider is loaded, appropriate
hooks are probed from the provider and the provider side hooks are
initialized after the provider is loaded.

A sample implementation to demostrate the use of TLS interface
is provided in dbsim/db_tls.cpp.

Also contains a change to thread service interface: The
thread exit virtual method was changed to function pointer
to allow thread exit path which does not involve C++.
2021-02-24 11:14:21 +02:00
515ac816f9 Add prefix argument to logger callback.
Refs codership/wsrep-lib#148
2020-12-11 12:24:33 +02:00
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
94f5696010 Provide logger callback for wsrep_load 2020-04-17 17:24:23 +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
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
052247144f Support recovery of XA transactions
* Add method `restore_prepared_transaction` to `client_state` class
  which restores a transaction state from storage given its xid.
* Add method `commit_or_rollback_by_xid` to terminate prepared XA
  transactions by xid.
* Make sure that transactions in prepared state are not rolled back
  when their master fails/partitions away.
2019-10-16 10:16:39 +02:00
eb4cf86c1e Implemented thread service support.
Added a wsrep::thread_service interface to allow application to
inject instrumented thread, mutex and condition variable implementation
for provider.

The interface is defined in include/wsrep/thread_service.hpp.
Sample implementation is provided in dbsim/db_threads.[h|c]pp.

This patch will also clean up some remaining dependencies to
wsrep-API compilation units so that the dependency to wsrep-API
is header only. This will extending the provider support to
later wsrep-API versions.
2019-10-14 09:30:15 +03: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
4285ff99ea codership/wsrep-lib#100 Support for assign_read_view() wsrep API call
Marshall the call from the `client_state` interface down to provider.
2019-05-08 15:07:45 +03: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
8e4777114b Update wsrep-API v26 to include enc signature fixes 2019-01-21 18:50:28 +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
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
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
05013c8d44 Support for UPDATE certification key type. 2018-12-15 19:59:11 +02:00
fd07ff12e4 Refs codership/wsrep-API#21 added support for the IMPLICIT_DEPS WS flag 2018-11-28 18:07:08 +01:00
8ffad51822 Fixed the definition of the encryption callback 2018-11-28 18:07:08 +01:00
3950ea3027 Refs codership/wsrep-lib#18 Small fixups
- fixed node ID assertion in on_connect() method,
   fixed "sanity checks" to allow reconnection to primary component
 - fixed code duplication in on_view() method
2018-11-23 23:27:09 +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
a942811ce7 User defined logger callback implementation
Added static wsrep::log::logger_fn() method to allow user to
provide logger callback.
2018-11-07 21:45:52 +02:00
ed7c4d7410 Add prepare flag to wsrep::provider::flag 2018-10-24 11:35:28 +03:00
c0c977f9ab Added GPLv2 licence and copyright headers. 2018-10-15 15:14:22 +03:00
94174b06e6 codership/galera-bugs#165 Update to wsrep encryption API
Update wsrep-API/v26 submodule. Cleanup. Empty callback handler for encrypt.
2018-10-11 20:40:13 +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
80ca03daaf Implemented SR transaction rollback. 2018-07-10 14:01:41 +03:00
3ff322386c Added must_exit boolean flag to high_priority_service interface
This is needed to allow slave threads to exit processing loop
if requested by the DBMS.
2018-07-06 16:18:59 +03:00
fcefe9f03b Provide additional provider error status. Fixed IST handling. 2018-07-05 11:31:47 +03:00
b9532e6497 Return provider status from set options. 2018-07-03 16:33:14 +03:00
3632e7823c Pass high_priority_service instead of void ptr for provider methods. 2018-07-03 07:48:35 +03:00
635eaf4c29 Refactored high priority service out of client service. 2018-07-02 18:22:24 +03:00
db18e91c42 Implemented client last_written_gtid, sync_wait 2018-06-30 07:44:09 +03:00
3d2af88428 Propagate incoming address to provider. 2018-06-29 17:46:11 +03:00
0851970c53 Bootstrap server service, fixes to server state management
* Added bootstrap service call to do DBMS side bootstrap operations
  during the cluster bootstrap.
* Added last_committed_gtid() to provider interface
* Implemented wait_for_gtid() provider call
* Pass initial position to the server state
2018-06-29 11:54:33 +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
2a53198f5c Protocol version and connected gtid
* Propagate server max protocol version to provider init options
* Store gtid from connected call to make cluster id and the connect
  position available
2018-06-26 11:34:05 +03:00
bd0ba5b01d Fixed key conversion in wsrep_provider_v26::enter_toi() 2018-06-26 09:13:56 +03:00
cad9176474 TOI replicating and applying codepaths 2018-06-25 09:28:51 +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
1f6a6db1e9 * Fixes to SST time server state management
* Logging tweaks
* Boolean to tune behavior on exception
2018-06-22 13:03:12 +03:00