1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-20 01:03:16 +03:00
Commit Graph

45 Commits

Author SHA1 Message Date
5ea78de6c2 Add support for custom provider implementation
- Add a set_provider_factory() method to server_state to allow
  injecting provider factory which will be called when the
  provider is loaded.

Other related changes:
- Implement to_string() helper method for id class.
- Fix id ostream operator human readable id printing.
- Pass victim client_service as an argument to provider::bf_abort()
  to allow passing victim context to custom provider.
- Implement prev() helper method for seqno class.
- Make server_state recover_streaming_appliers_if_not_recovered()
  public. In some recovery scenarios the method must be called outside
  of server_state internal code paths.
- Add storage_service requires_globals() method. The storage service
  implementation may override this to return false if changing to
  storage service context does not require store/reset globals.
- Change view final() to also require that the view status is not
  primary for the view to be final. Also change the method name to
  is_final() to avoid confusion with C++ final identifier.
- Fixes to server state handling in disconnecting and disconnected
  states.
- Keep TOI meta data over whole TOI critical section.

Co-authored-by: Denis Protivensky <denis.protivensky@galeracluster.com>
2025-01-14 16:51:26 +02:00
3de594b662 Add application defined sequential consistency for certification
Client state methods before_prepare() and before_commit() accept
a callback which is called by the provider after it can guarantee
sequential consistency. This allows application threads which wish to
maintain sequential consistency to enter before_prepare() and
before_commit() calls concurrently without waiting the prior call
to finish.
2024-11-28 13:10:16 +02:00
31db847676 MDEV-32363 Add interface to set node isolation mode in provider 2024-05-21 12:38:34 +03:00
626c0b7b3b Fix -Winconsistent-missing-destructor-override warnings 2023-03-30 13:46:14 +03: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
7245db4704 Enable -Wsuggest-override if supported by the compiler. 2020-10-22 17:31:21 +03: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
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
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
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
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
c0c977f9ab Added GPLv2 licence and copyright headers. 2018-10-15 15:14:22 +03:00
80ca03daaf Implemented SR transaction rollback. 2018-07-10 14:01:41 +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
db18e91c42 Implemented client last_written_gtid, sync_wait 2018-06-30 07:44:09 +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
81ac78913a Initial implementation of client_state TOI mode. 2018-06-21 11:45:18 +03:00
3a8861b26b * Moved causal reads/gtid wait into server state interface
* Changed undefined seqno to be defined as -1
2018-06-21 10:37:55 +03:00
ef0fb72b73 * Added size exceeded error code
* Return provider status from selected client_state calls
* Added more methods to provider interface
2018-06-20 19:44:20 +03:00
5c3c972947 Provide access to native wsrep API handle. 2018-06-19 09:41:04 +03:00
0e4c7f16a9 Pass ws_handle as const reference to provider replay() 2018-06-19 09:36:15 +03:00
d1a1e298e9 Removed wsrep_api.h dependency from view.hpp 2018-06-18 20:39:25 +03:00
ef4baa9f9d Renamed server_context to server_state. 2018-06-17 10:07:48 +03:00
0b6e49474f Tests and fixes for replaying. 2018-06-14 15:00:40 +03:00
9e8e6d47ba * Unit test for SR 2PC
* Removed redundant data class
* Introduced const_buffer and mutable_buffer
* Transaction context and client context interface refactoring
2018-06-12 18:04:32 +03:00
d6f185c278 Refactored provider specific code out of server_context.cpp 2018-06-12 10:52:56 +03:00
97d9f93648 Refactored seqno and id classes out of provider.hpp 2018-06-12 10:20:58 +03:00
e74b214c9c Provider type abstraction, partially completed. 2018-06-09 23:28:02 +03:00
d3cb537d1e Changed project name to wsrep-lib. 2018-06-03 21:56:28 +03:00
0988978826 Moved public API includes under include/trrep 2018-05-07 19:40:10 +03:00
e3ca0d699b Added logger class, BF abort debugging. 2018-04-30 17:28:18 +03:00
ea512d9c36 Ported to latest wsrep API v26 2018-04-20 16:54:10 +03:00
5c1d390b74 DBMS simulator runs client load 2018-04-19 18:44:56 +03:00
3510d0739c Added SST methods, able to start several nodes in simulator 2018-04-19 15:03:38 +03:00
3c6eff581c DBMS simulator is now able to start and stop one server
Other:
* Added trrep::condition_variable
* Added trrep::view
2018-04-19 13:09:36 +03:00
557d43657c Initial version of dbms_simulator, partial wsrep provider loading 2018-04-18 18:16:55 +03:00
bed41a5ffd Made provider abstract interface instead of using pimpl.
Added forgotten mock_client_context.hpp.
2018-04-18 12:46:25 +03:00
ab795f7979 Mock server context 2018-04-17 15:01:48 +03:00