1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-04-25 17:42:30 +03:00

14 Commits

Author SHA1 Message Date
Teemu Ollakka
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
Daniele Sciascia
22921e7082 Cache rollback events that failed to replicate for later retry
This patch introduces a queue to store ids of transactions that failed
to send a rollback fragment in streaming_rollback(). This is to avoid
potentially  missed rollback fragments when a cluster splits and then
later reforms. Rollback fragments would be missing if a node rolled
back a transaction locally (either BFed or voluntary rollback) while
non-primary, and the attempt to send rollback fragment failed in
transaction::streaming_rollback().
Transaction that fail to send rollback fragment can proceed to
rollback locally.  However we must ensure that rollback fragments for
those transactions are eventually delivered by the cluster. This must
be done before a potentially conflicting writeset causes BF-BF
conflicts in the rest of the cluster.
2021-09-30 10:41:57 +02:00
Teemu Ollakka
477a71dd46 Updated wsrep-API, added -Wconversion to compiler flags, fixed errors. 2019-10-11 09:56:07 +03:00
Leandro Pacheco
71f3fb2d01 close SR transacions on equal consecutive views
Fixes a bug where the fact that an SR master leaves the primary view
gets missed. When two consecutive primary views have the same
membership we now assume that every SR needs to be rolled back, as the
system may have been through a state of only non-primary components.
2019-03-05 09:41:48 +01:00
Daniele Sciascia
1be3ef9529 Expose to_c_string() function for wsrep::view::status 2018-12-20 11:27:49 +01:00
Teemu Ollakka
36dbb37645 codership/wsrep-lib#35 Rewrote member_index() to use iterators
Use iterators for scanning members vector in order to avoid
issues with integer signedness and range checks. The vector is
usually rather small and not in hot codepath, so performance
is here not an issue.

Added unit test for member_index() method.
2018-12-15 13:46:42 +00:00
Alexey Yurchenko
fb14883547 Recover current view from state after SST.
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
2018-11-12 12:47:42 +02:00
Alexey Yurchenko
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
Teemu Ollakka
c0c977f9ab Added GPLv2 licence and copyright headers. 2018-10-15 15:14:22 +03:00
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
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
Teemu Ollakka
d1a1e298e9 Removed wsrep_api.h dependency from view.hpp 2018-06-18 20:39:25 +03:00
Teemu Ollakka
d3cb537d1e Changed project name to wsrep-lib. 2018-06-03 21:56:28 +03:00