Syntax:
WAIT_FOR_EXECUTED_GTID_SET(gtid_set[, timeout])

Wait until the server has applied all of the transactions whose global
transaction identifiers are contained in gtid_set; that is, until the
condition GTID_SUBSET(gtid_subset, @@GLOBAL.gtid_executed) holds. See
https://dev.mysql.com/doc/refman/8.4/en/replication-gtids-concepts.html
for a definition of GTID sets.

If a timeout is specified, and timeout seconds elapse before all of the
transactions in the GTID set have been applied, the function stops
waiting. timeout is optional, and the default timeout is 0 seconds, in
which case the function always waits until all of the transactions in
the GTID set have been applied. timeout must be greater than or equal
to 0; when running in strict SQL mode, a negative timeout value is
immediately rejected with an error (ER_WRONG_ARGUMENTS
(https://dev.mysql.com/doc/mysql-errors/8.4/en/server-error-reference.html
#error_er_wrong_arguments)); otherwise the function returns NULL,
and raises a warning.

WAIT_FOR_EXECUTED_GTID_SET() monitors all the GTIDs that are applied on
the server, including transactions that arrive from all replication
channels and user clients. It does not take into account whether
replication channels have been started or stopped.

For more information, see
https://dev.mysql.com/doc/refman/8.4/en/replication-gtids.html.

URL: https://dev.mysql.com/doc/refman/8.4/en/gtid-functions.html

