codership / wsrep-api Goto Github PK
View Code? Open in Web Editor NEWWrite Set Replication API specification
License: GNU General Public License v2.0
Write Set Replication API specification
License: GNU General Public License v2.0
Struct wsrep will not allow using wsrep namespace in C++ code:
test.cpp:6:1: error: ‘namespace wsrep { }’ redeclared as different kind of symbol
{
^
In file included from test.cpp:2:0:
wsrep_api.h:634:8: note: previous declaration ‘struct wsrep’
struct wsrep {
Rename struct wsrep
to struct wsrep_st
to allow using namespace wsrep.
Having wsrep_trx_meta_t available in commit_order_enter/commit_order_leave calls should reduce bookkeeping on provider side as commit ordering is done based on gtid.seqno.
SST request callback does not have application context pointer. This requires that the application state is contained in global variables.
Suggested fix: Add application context pointer in sst_request_cb callback type.
In some cases not all of the trx dependencies may be expressed in the key set. In that case the parallel applying window for the writeset must be limited to the last seen trx to ensure that it sees all effects it could potentially see.
Streaming replication transaction can be identified with a pair of node ID, local transaction ID. Pass this identifier for applier callbacks.
This is part of implementation of https://github.com/codership/Engineering/wiki/Foreign_Key_Optimization_Combined
Currently (v25) wsrep_key_type looks as follows:
/*! Key type:
* EXCLUSIVE conflicts with any key type
* SEMI reserved. If not supported, should be interpreted as EXCLUSIVE
* SHARED conflicts only with EXCLUSIVE keys */
typedef enum wsrep_key_type
{
WSREP_KEY_SHARED = 0,
WSREP_KEY_SEMI,
WSREP_KEY_EXCLUSIVE
} wsrep_key_type_t;
where WSREP_KEY_SEMI
was intended to stand for "semi-exclusive" keys, but had to be hijacked to stand for "strictly shared" key type that was needed to solve customer's issues with collision on FKs. For the sake of preserving the API it was not renamed.
Final implementation of https://github.com/codership/Engineering/wiki/Foreign_Key_Optimization_Combined requires 4 key types. Since it involves changing the API we can adopt better, perhaps more intuitive IDs for the members.
This is the suggestion:
typedef enum wsrep_key_type
{
WSREP_KEY_SHARED = 0,
WSREP_KEY_REFERENCE,
WSREP_KEY_UPDATE.
WSREP_KEY_EXCLUSIVE
} wsrep_key_type_t;
where WSREP_KEY_REFERENCE
will stand for "strictly shared" and WSREP_KEY_UPDATE
- for "semi-exclusive" (notice that both "strictly shared" and "semi-exclusive" were themselves very poorly chosen terms for lack of better ideas)
It is an optional call to inform provider about the read views (identified by GTID) used by application. Use case: snapshot isolation. Signature:
wsrep_status_t assign_read_view(wsrep_t* wsrep, wsrep_ws_handle_t* ws, const wsrep_gtid_t* rv);
Application passes read view ID to provider in rv
. If rv == NULL
provider uses the current internal value.
Replaying is not supposed to change transaction id or provider opaque pointer associated to write set. Therefore the ws_handle
parameter should be passed as const wsrep_ws_handle_t*
for replay_trx()
call.
for submitting unordered events to application
The sst_request_cb
requires allocating memory for sst_req
in the DBMS, but the memory is freed in the provider. If the DBMS is built with custom allocator, it leads to malloc/free allocator mismatch and therefore to an undefined behavior.
A flag is needed to mark the fragment that prepares the trx.
This is needed to distinguish between different error conditions in case of error voting. The integer should be application defined code specific to that sort of failure. 0 is treated as no failure.
There are completely unused state/state_len parameters in
These unused parameters should be removed as there is no intended use for them now or in the future.
Enhance wsrep api to support the following use case:
If the master of a prepared XA transaction fails, then it should be possible to terminate (commit or rollback) the transaction from another node in the cluster.
In order to do so, the application should be able to pass the necessary information to the provider so that a commit/rollback fragment can be sent on behalf of the failed master. The information consists of server and transaction ids.
One possible way to achieve this would be to add function with the following signature:
wsrep_status_t xa_recover(const wsrep_uuid_t*, wsrep_trx_id_t)
or
wsrep_status_t xa_recover(const wsrep_stid_t*)
xa_recover
would be called before terminating the transaction through certify()
or rollback()
.
Wsrep-API should be amended with an interface which could be used to show internal Galera monitor states.
This will be specific to Galera provider, and the interface can expose some Galera internals if necessary.
The idea is that instead of implementing its own encryption algorithm (that may be lacking in security or features) provider will use a callback provided by replication.
The reason is that apply callback signature does not allow multiple calls because there is no way to instruct the callback which writeset record is the last one in the set and when commit_order_enter()/commit_order_leave()
should be called.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.