|
51 | 51 | SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
|
52 | 52 | SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
|
53 | 53 |
|
| 54 | +# All connections are to the same server. One transaction occurs on con1. It is |
| 55 | +# commited before con2 is started. con2 transaction violates the unique key contraint. This |
| 56 | +# type of group commit is binlog_group_commit_trigger_lock_wait so that further con2 |
| 57 | +# transactions will occur afterwards as they may be as result of the ER_DUP_ENTRY on the |
| 58 | +# application side. |
54 | 59 | # before: binlog_group_commit=0, binlog_group_commit_trigger_count=0
|
55 | 60 | # before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=0
|
56 | 61 | # after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_lock_wait+1
|
|
90 | 95 | SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
|
91 | 96 | SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
|
92 | 97 |
|
| 98 | +# All connections are to the same server. 3 non-conflicting transaction occur |
| 99 | +# on each connection. The binlog_commit_wait_count=3 at the start therefore 1 |
| 100 | +# group is committed by virtue of reaching 3 transactions. Hence |
| 101 | +# binlog_group_commit_trigger_count is incremented. |
93 | 102 | # before: binlog_group_commit=1, binlog_group_commit_trigger_count=0
|
94 | 103 | # before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=1
|
95 | 104 | # after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_count+1
|
@@ -136,6 +145,9 @@ reap;
|
136 | 145 | SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
|
137 | 146 | SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
|
138 | 147 |
|
| 148 | +# All connections are to the same server. con2 and con3 updates are aquiring |
| 149 | +# the same row lock for a=1. Either con2 or con3 will be in a lock wait |
| 150 | +# thefore the binlog_group_commit_trigger_lock_wait is incremented. |
139 | 151 | # before: binlog_group_commit=2, binlog_group_commit_trigger_count=1
|
140 | 152 | # before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=1
|
141 | 153 | # after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_lock_wait+1
|
@@ -163,6 +175,8 @@ reap;
|
163 | 175 | SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
|
164 | 176 | SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
|
165 | 177 |
|
| 178 | +# The con1 and con2 transactions above are combined with the 'send UPDATE t1 SET b=b+10 WHERE a=1;' |
| 179 | +# on con3 from the previous block. So we have 3 so this is a count based group. |
166 | 180 | # before: binlog_group_commit=3, binlog_group_commit_trigger_count=1
|
167 | 181 | # before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=2
|
168 | 182 | # after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_count+1
|
@@ -190,6 +204,10 @@ SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
|
190 | 204 | SELECT IF(@b < 4, CONCAT("Error: too little time elapsed: ", @b, " seconds < 4"),
|
191 | 205 | IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")));
|
192 | 206 |
|
| 207 | +# con1 pushes 1 transaction. The count was for 3 to occur before a group commit. |
| 208 | +# The timeout is 5 seconds but we allow between 4 and 20 because of the fragile nature |
| 209 | +# of time in test. This is a timeout causing the commit so binlog_group_commit_trigger_timeout |
| 210 | +# is incremented. |
193 | 211 | # before: binlog_group_commit=4, binlog_group_commit_trigger_count=2
|
194 | 212 | # before: binlog_group_commit_trigger_timeout=0, binlog_group_commit_trigger_lock_wait=2
|
195 | 213 | # after: binlog_group_commit+1 by reason of binlog_group_commit_trigger_timeout+1
|
|
0 commit comments