Commit 3fbb4d2
committed
perf(cutover): drop two 1s sleeps from the locked cut-over window
Both sleeps happened while the original table was write-locked, so they
were pure table downtime:
- executeWriteFuncs slept 1s whenever both queues were empty, which is the
steady state once row copy is done. The cut-over sentinel arrives on
applyEventsQueue and had to wait that sleep out. It now blocks on both
queues with a 1s timeout instead.
- waitForRename watched for the blocking RENAME through retryOperation,
which backs off a flat 1s. The first check usually runs before the RENAME
shows up. It now checks every 10ms, via a new retryOperationWithInterval
(retryOperation with the attempt count and wait made explicit).
"Lock & rename duration" over the 73 localtests that reach cut-over. Before,
it was ~1s on essentially every cut-over:
mariadb:11.8 p50 9ms p90 21ms p99 90ms max 90ms
mysql:8.4.3 p50 23ms p90 31ms p99 96ms max 96ms
The tail is not this code path. It is waitForEventsUpToLock: on both
flavours the same four cases, which happen to see no DML during the
migration, spend 54-77ms waiting for the sentinel to come back through an
otherwise idle binlog stream. No case with concurrent DML exceeds 50ms.
That delay reproduces with a plain binlog reader, so it is in binlog
delivery, not in gh-ost.
TestCutOverLossDataCaseLockGhostBeforeRename now locks the ghost table
before un-postponing, instead of relying on cut-over being slow.
Fixes #16301 parent f7a42f6 commit 3fbb4d2
2 files changed
Lines changed: 51 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
170 | 176 | | |
171 | 177 | | |
172 | | - | |
173 | | - | |
174 | | - | |
| 178 | + | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
1119 | 1124 | | |
1120 | 1125 | | |
1121 | 1126 | | |
1122 | | - | |
1123 | | - | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
1124 | 1142 | | |
1125 | 1143 | | |
1126 | 1144 | | |
| |||
1936 | 1954 | | |
1937 | 1955 | | |
1938 | 1956 | | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
1939 | 1962 | | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
1940 | 1969 | | |
1941 | 1970 | | |
1942 | 1971 | | |
| |||
1956 | 1985 | | |
1957 | 1986 | | |
1958 | 1987 | | |
1959 | | - | |
| 1988 | + | |
1960 | 1989 | | |
1961 | | - | |
1962 | | - | |
1963 | | - | |
1964 | | - | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
1965 | 1993 | | |
1966 | 1994 | | |
1967 | 1995 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1250 | 1250 | | |
1251 | 1251 | | |
1252 | 1252 | | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
1258 | | - | |
1259 | | - | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
1260 | 1256 | | |
1261 | 1257 | | |
1262 | 1258 | | |
1263 | 1259 | | |
1264 | 1260 | | |
1265 | 1261 | | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
1266 | 1270 | | |
1267 | 1271 | | |
1268 | 1272 | | |
| |||
0 commit comments