Commit 641f211
committed
fix(applier): disable NOWAIT for row-copy under MTS to avoid 3572 FATAL
Under MTS mode (NumWorkers > 1), parallel DML workers hold row locks on
the ghost table concurrently with row-copy. SELECT ... FOR SHARE NOWAIT
fails immediately with errno 3572 when it encounters those locks, and
the combined retry budget (20 internal + 3 outer) is insufficient under
heavy write load on MySQL 8.4, causing the migration to FATAL.
Extract the noWait decision into rowCopyUsesNoWait() which returns
false when NumWorkers > 1, making row-copy use LOCK IN SHARE MODE
(blocking wait) instead. This is the correct trade-off: DML apply is
latency-sensitive and should not be preempted by row-copy retries, so
row-copy should wait for DML locks to release rather than failing fast.
Single-threaded mode on MySQL 8.x retains NOWAIT behaviour unchanged.1 parent f00e6d4 commit 641f211
2 files changed
Lines changed: 40 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1107 | 1107 | | |
1108 | 1108 | | |
1109 | 1109 | | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
| 1110 | + | |
| 1111 | + | |
1114 | 1112 | | |
1115 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
1116 | 1128 | | |
1117 | 1129 | | |
1118 | 1130 | | |
| |||
1131 | 1143 | | |
1132 | 1144 | | |
1133 | 1145 | | |
1134 | | - | |
1135 | | - | |
| 1146 | + | |
1136 | 1147 | | |
1137 | 1148 | | |
1138 | 1149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
236 | 259 | | |
237 | 260 | | |
238 | 261 | | |
| |||
0 commit comments