wsrep_sync_wait controls "strict cluster-wide causality checks" , and it is a session variable.
It seems that when COM_CHANGE_USER is executed, the value of wsrep_sync_wait has no effect whatsoever, no matter if:
the global value of wsrep_sync_wait is applied to the session
if the session variable wsrep_sync_wait is set explicitly at by the client connection
How to reproduce
create a simple galera cluster with 3 nodes
SET GLOBAL wsrep_sync_wait=7 on all the 3 nodes
configure the PHP script attached (username, password, schema, number of loops, etc)
it uses node1 for writes, and node2 and nodes3 for reads
create a test table with just one columns
in a loop of 200 cycles:
a. delete all rows from the test table
b. insert rows on the test table on node1
c. count rows on node2 and node3
execute COM_CHANGE_USER on the connections to node2 and node3
repeats point 4
explicitly set wsrep_sync_wait=0 and then wsrep_sync_wait=7 to both node2 and node3 (setting 0 is not needed, we are just trying to change it twice in case make any different, but it doesn't)
repeats point 4
Expected behavior
On points 4.c , 6.c and 8.c: the number of rows read should always be equal to the number of rows inserted in point 4.b , 6.b and 8.b
Actual behavior
On point 4.c: the number of rows read are always equal to the number of rows inserted in point 6.b and 8.b
On points 6.c and 8.c: the number of rows read are not always equal to the number of rows inserted in point 6.b and 8.b
The test was reproduce on various version of Galera, including 10.6.5-MariaDB-log and the official 8.0.26-26.8 (from Codership).
wsrep_sync_wait---com_change_user.php.txt
Description
wsrep_sync_wait controls "strict cluster-wide causality checks" , and it is a session variable. It seems that when
COM_CHANGE_USER
is executed, the value ofwsrep_sync_wait
has no effect whatsoever, no matter if:wsrep_sync_wait
is applied to the sessionwsrep_sync_wait
is set explicitly at by the client connectionHow to reproduce
SET GLOBAL wsrep_sync_wait=7
on all the 3 nodesScript details
The script performs the following:
COM_CHANGE_USER
on the connections to node2 and node3wsrep_sync_wait=0
and thenwsrep_sync_wait=7
to both node2 and node3 (setting0
is not needed, we are just trying to change it twice in case make any different, but it doesn't)Expected behavior
On points 4.c , 6.c and 8.c: the number of rows read should always be equal to the number of rows inserted in point 4.b , 6.b and 8.b
Actual behavior
On point 4.c: the number of rows read are always equal to the number of rows inserted in point 6.b and 8.b On points 6.c and 8.c: the number of rows read are not always equal to the number of rows inserted in point 6.b and 8.b
Example output:
The test was reproduce on various version of Galera, including 10.6.5-MariaDB-log and the official 8.0.26-26.8 (from Codership). wsrep_sync_wait---com_change_user.php.txt