Repository navigation
Commit 9e98d36
authored
[improvement](mtmv) Journal MV alter ops under the MV lock and read IVM info lock-free (apache#69256)
Two lock/journaling gaps in the MTMV metadata path.
`ALTER_REFRESH_INFO` and `ALTER_STATUS` changed the MV metadata under
the MV write lock but enqueued the matching journal record only after
that lock was released (`Alter.processAlterMTMV`). A task result
journaled in between could be replayed on the other side of the alter,
and a live `ALTER_STATUS` could lose its record if a later step threw
after the metadata had already moved.
`MTMV.getIvmInfo()` took the MV write lock on the query path (`isIvm()`
reads it). `enableIvm` is decided at CREATE and no ALTER path changes
it, and the only other mutable field, the sequence prefix, is read when
a refresh plans and advanced when the same refresh's transaction commits
-- both under the MV's `MTMVJob` write lock, which serializes refreshes
of one MV.
Changes:
- Apply `ALTER_REFRESH_INFO` / `ALTER_STATUS` and submit their journal
record under one MV write lock; `processAlterMTMV` awaits the entry
after the lock is released, like the other journaled MTMV changes.
- Make `getIvmInfo()` a lock-free read and mark the payload reference
`volatile`, so a replay that replaces it publishes it safely. `isIvm()`
and `getNextSequencePrefix()` no longer queue for the MV write lock.
- Correct the `MTMVTask` comment that claimed base table snapshots were
captured under a read lock: they are captured before the read, without
one.
- The remaining item of the same list, the `addTaskResult` race on
`getPartitionNames()`, was fixed separately by apache#69166.1 parent 886cb3e commit 9e98d36
3 files changed
Lines changed: 78 additions & 25 deletions
File tree
- fe/fe-core/src/main/java/org/apache/doris
- alter
- catalog
- job/extensions/mtmv
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| |||
1357 | 1358 | | |
1358 | 1359 | | |
1359 | 1360 | | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
1360 | 1366 | | |
1361 | 1367 | | |
1362 | 1368 | | |
1363 | 1369 | | |
1364 | 1370 | | |
1365 | | - | |
| 1371 | + | |
1366 | 1372 | | |
1367 | 1373 | | |
1368 | | - | |
| 1374 | + | |
1369 | 1375 | | |
1370 | 1376 | | |
1371 | 1377 | | |
| |||
1401 | 1407 | | |
1402 | 1408 | | |
1403 | 1409 | | |
1404 | | - | |
1405 | | - | |
| 1410 | + | |
| 1411 | + | |
1406 | 1412 | | |
1407 | 1413 | | |
1408 | 1414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
227 | 235 | | |
228 | 236 | | |
229 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
230 | 241 | | |
231 | 242 | | |
232 | 243 | | |
| 244 | + | |
233 | 245 | | |
234 | 246 | | |
235 | 247 | | |
| |||
238 | 250 | | |
239 | 251 | | |
240 | 252 | | |
241 | | - | |
242 | | - | |
| 253 | + | |
| 254 | + | |
243 | 255 | | |
244 | 256 | | |
245 | 257 | | |
| |||
252 | 264 | | |
253 | 265 | | |
254 | 266 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
259 | 289 | | |
260 | 290 | | |
261 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
262 | 301 | | |
263 | 302 | | |
264 | 303 | | |
| |||
757 | 796 | | |
758 | 797 | | |
759 | 798 | | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
760 | 812 | | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
769 | | - | |
| 813 | + | |
770 | 814 | | |
771 | 815 | | |
772 | 816 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
896 | | - | |
897 | | - | |
898 | | - | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
899 | 902 | | |
900 | 903 | | |
901 | 904 | | |
| |||
0 commit comments