[MDEV-24851] Semi-synchronous replication behaviour on statement or transaction Created: 2021-02-12  Updated: 2021-03-30

Status: Open
Project: MariaDB Server
Component/s: Replication
Fix Version/s: None

Type: Task Priority: Major
Reporter: Oli Sennhauser Assignee: Andrei Elkin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Feature Request:

One of our customers was asking if MariaDB semi-synchronous replication can do semi-synchronous replication on demand on per statement or per transaction level as MongoDB can do.

I was not aware of such a functionality and studied docu but I did not find any hint about this feature.

https://mariadb.com/kb/en/mariadb-replication-overview-for-sql-server-users/

Also the variables cannot be changed on a per session base but only globally.

So I checked MongoDB docu and there is indeed such a functionality:

https://docs.mongodb.com/manual/reference/write-concern/
https://docs.mongodb.com/manual/core/transactions/#transactions-write-concern
https://docs.mongodb.com/manual/core/replica-set-write-concern/

Feature request: Implement similar functionality like write concern in MariaDB (semi-synchronous) Replication.

Use case: In huge countries with shaky network connections this seems to be a need.



 Comments   
Comment by Andrei Elkin [ 2021-03-29 ]

oli Privet ! I must say the suggestion has some flavor of inconsistency, replication is not bound to work on
the transaction level granularity, but that's how it has been so far.

But what if..
The acknowledgement of individual statements can be (hopefully practically for your customer too) emulated
with XA transactions which mariadb replicates starting from 10.5.2.
That is if the user has a big transaction she could split into a number of
XA START 'xid_i'; /* load */; XA END 'xid_i'; XA PREPARE 'xid_i' for i \in 1..i_max.
And all the fragments have been acknowledged by slaves, XA COMMIT 'xid_i' would follow on the master also to be ack-ed on
by slaves.

Could this refinement make any sense for you?

Cheers,

Andrei

Comment by Oli Sennhauser [ 2021-03-29 ]

Privet Andrei!

I will ask the customer... To be honest, I am not a big fan of XA. Quite complicated... Not KISS.

Regards,
Oli

Generated at Thu Feb 08 09:33:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.