Commit d613f03
committed
MDEV-37541 Race of rolling back and committing transaction to binlog
Two transactions could binlog their completions in opposite to how it
is done in Engine. That is is rare situations ROLLBACK in Engine of
the dependency parent transaction could be scheduled by the
transaction before its binlogging. That give a follower dependency
child one get binlogged ahead of the parent.
For fixing this bug its necessary to ensure the binlogging phase is
always first one in the internal one-phase rollback protocol.
The commit combines
1. a code polishing piece over a part of MDEV-21117 that
made binlog handlerton always commit first in no-2pc cases and
2. the same rule now applies to the rollback.
An added test demonstrates how the child could otherwise reach binlog
before its parent.1 parent 22db2df commit d613f03
File tree
4 files changed
+58
-25
lines changed- mysql-test/suite/binlog/t
- sql
4 files changed
+58
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
5 | 14 | | |
6 | 15 | | |
7 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2152 | 2152 | | |
2153 | 2153 | | |
2154 | 2154 | | |
2155 | | - | |
| 2155 | + | |
2156 | 2156 | | |
2157 | | - | |
2158 | | - | |
2159 | | - | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
2160 | 2183 | | |
2161 | 2184 | | |
2162 | 2185 | | |
| |||
2174 | 2197 | | |
2175 | 2198 | | |
2176 | 2199 | | |
2177 | | - | |
2178 | | - | |
2179 | | - | |
2180 | | - | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
2181 | 2209 | | |
2182 | | - | |
2183 | | - | |
| 2210 | + | |
| 2211 | + | |
2184 | 2212 | | |
2185 | | - | |
2186 | | - | |
2187 | | - | |
2188 | | - | |
2189 | 2213 | | |
2190 | 2214 | | |
2191 | 2215 | | |
| |||
2311 | 2335 | | |
2312 | 2336 | | |
2313 | 2337 | | |
2314 | | - | |
2315 | | - | |
2316 | | - | |
2317 | | - | |
2318 | | - | |
2319 | | - | |
2320 | | - | |
2321 | | - | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
2322 | 2346 | | |
| 2347 | + | |
2323 | 2348 | | |
2324 | | - | |
2325 | 2349 | | |
2326 | 2350 | | |
2327 | 2351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
| |||
2489 | 2488 | | |
2490 | 2489 | | |
2491 | 2490 | | |
2492 | | - | |
| 2491 | + | |
2493 | 2492 | | |
2494 | 2493 | | |
2495 | 2494 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1277 | 1277 | | |
1278 | 1278 | | |
1279 | 1279 | | |
| 1280 | + | |
1280 | 1281 | | |
1281 | 1282 | | |
1282 | 1283 | | |
| |||
0 commit comments