[MDEV-20769] MASTER_GTID_WAIT to work for replicated galera GTIDS Created: 2019-10-07 Updated: 2023-04-20 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Replication |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major |
| Reporter: | Daniel Black | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | feature-request | ||
| Issue Links: |
|
||||||||
| Description |
|
To solve the ability to handle a replication delay (async or galera) in a variety of replication topologies, without an application needing to know the topology (beyond reader/writer nodes), MASTER_GTID_WAIT should wait for both async and galera GTID replication to be applied. The WSREP_LAST_WRITTEN_GTID/WSREP_LAST_SEEN_GTID/ WSREP_SYNC_WAIT_UPTO_GTID that got dumped in MariaDB 10.4/ Galera-4 fails to consider async replication topologies exist with Galera or understand the deep frustration in 10.4 target based on [~ratzpo] comment https://lists.launchpad.net/maria-developers/msg11691.html. |
| Comments |
| Comment by Jan Lindström (Inactive) [ 2020-05-13 ] | |||||||||||
|
mkaruza Does current Galera GTID wait mechanism full-will this requirement? | |||||||||||
| Comment by Mario Karuza (Inactive) [ 2020-05-31 ] | |||||||||||
|
There is galera_sync_wait_upto test which test wait functionality with and without binlog. WSREP_LAST_WRITTEN_GTID/WSREP_LAST_SEEN_GTID/ WSREP_SYNC_WAIT_UPTO_GTID used before galera UUID now it is based on GTID format so there was no functionality change. So to conclude, with this changes we reduced "noise" seqnos which galera could produce, for example galera could increase seqno on any "internal" mechanism while now GTID's correspond to committed transactions. If there is real life scenarios which are not covered with current implementation they can be reported and we will look into way to improve this functionality. | |||||||||||
| Comment by Ralf Gebhardt [ 2020-06-15 ] | |||||||||||
|
Hi danblack, can this task be closed from your point of view, given that | |||||||||||
| Comment by Daniel Black [ 2020-06-17 ] | |||||||||||
|
MDEV-20720 comment was the described usage scenario and the galera only implementation is covered by the WSREP* functions as implemented. Extending this to a scenario where a classical replication is the the mix (per 3rd bullet point) would require a different set of SQL calls. galera_sync_wait_upto has binlog enabled, however it tests only WSREP_SYNC_WAIT_UPTO_GTID doesn't have a async topology An application dealing with a mixed replication topology to handle an up to date read from something previously written would be:
The trouble is the function to determine if this is a classical slave is:
Maybe the code should be:
However this is going to wait for both, right? The horizontal scaling of galera and mariadb classical replication is one of the great things about MariaDB. The introduction of `MASTER_GTID_WAIT` back in 10.0 meant a basic TCP load balancer between client and DB server could facilitate a greater utilization of read only replica servers which still giving the client application a consistent view of their data, despite the async delays. Application frameworks like django and drupal have multi databases sources and and easy mechanism to extend this account read/write splits regardless of topology would be useful in producing an ecosystem compatible product. So I'm asking for a single functionality `GTID_WAIT` function (however named - WAIT_FOR_EXECUTED_GTID_SET same as MySQL for consistent community ecosystem use) that doesn't depend on the underlying technology which as far as I can tell, doesn't exist yet. Delivering a server that has a historically fractured view of GTID is well on the way to be fixed with This would put MariaDB functionality on equal footing with MySQL's WAIT_FOR_EXECUTED_GTID_SET which notably doesn't have different functions for group replication vs classical replication because to the end application, it doesn't, and shouldn't, actually matter. | |||||||||||
| Comment by Mario Karuza (Inactive) [ 2020-06-23 ] | |||||||||||
|
I have discussed with Daniel his specific scenario which is: async replication between 2 galera clusters. Currently WSREP GTID functions will work in cluster where node is, so there is no possibility to use WSREP_SYNC_WAIT_UPTO with GTID that are not in same cluster (i.e. one can not wait for GTID's defined in other cluster connected with async replication). So to synchronize 2 clusters with async replication, native functions should be used. For reference one can look into similar situation which we test with galera_3nodes.galera_gtid_2_cluster. Anyhow, it looks that providing universal sync wait for all topologies could be beneficial - but this it outside of current GTID scope. | |||||||||||
| Comment by Jan Lindström [ 2023-04-20 ] | |||||||||||
|
ralf.gebhardt |