Change provider_options so that it does not depend on provider.
Call into config_service when provider is created, i.e. after
library is loaded, before it is initialized, so that we can
inject additional options at startup.
Change the signature of the call provider options callback to
take provider_options object as parameter.
- 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>
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.
Removed calls to assert() from public headers to have
full control when assertions are enabled in wsrep-lib
code regardless of parent project build configuration.
Moved methods containing assertions and non-trivial
code from headers into compilation units.
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++.
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
- 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.
* 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.
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.
- 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
* Implemented encryption callback and enc_set_key
* Added pure virtual functions for encryption functionality
* Set enc key if provider was not loaded on time
When member joins the group and needs to receive an SST it won't
receive the corresponding menbership view event because the SST
happens after the event and will already include the effects of
all events ordered before it. The view then must be recovered from
the received state.
Minor renames and cleanups.
References codership/wsrep-lib#18
* Count separately fragments certified and fragments stored in
streaming context. Storing the fragment may ultimately fail
due to BF abort even if the fragment was succesfully certified.
Therefore we need to have separate counter for certified fragments
to determine if the transaction is streaming and seqnos of fragments
which have been succesfully stored.
* Provider release is called only after succesful fragment certification
and fragment store.
* Fixed handling of write sets with rollback flag set in apply_write_set()
* 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