Using obtained GTID to route queries to replica tablet type if and only if the replica has executed at least or beyond the given GTID, which provides a casual consistency guarantee and option to offload such reads from master.
One of our actual use cases is that we have a binlog stream subscriber processing each row update event, and that is turned into a query to master to gather enough information for indexing purpose.
The event we received or processed is associated with the GTID, and it needs to get just a snapshot that guarantees to be after the GTID in relation. One of the option we have is to use the https://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html#function_wait-until-sql-thread-after-gtids
but that's not quite ideal as it could have a blocking effect, and causing exhaustion of resources if all queries got stuck waiting for the GTID to be executed, we're looking for some option more async in nature.
Note that, the actual method of obtaining the GTID is not in scope of this:
Feature Description
Using obtained
GTID
to route queries to replica tablet type if and only if the replica has executed at least or beyond the givenGTID
, which provides a casual consistency guarantee and option to offload such reads frommaster
.For reference: https://proxysql.com/blog/proxysql-gtid-causal-reads
Use Case(s)
One of our actual use cases is that we have a binlog stream subscriber processing each row update event, and that is turned into a query to
master
to gather enough information for indexing purpose. The event we received or processed is associated with theGTID
, and it needs to get just a snapshot that guarantees to beafter
theGTID
in relation. One of the option we have is to use the https://dev.mysql.com/doc/refman/5.6/en/gtid-functions.html#function_wait-until-sql-thread-after-gtids but that's not quite ideal as it could have a blocking effect, and causing exhaustion of resources if all queries got stuck waiting for theGTID
to be executed, we're looking for some option more async in nature.Note that, the actual method of obtaining the
GTID
is not in scope of this: