Repository navigation
Commit 56f29f5
committed
Clear selected loop work and regenerate only what was replaced
Clearing one task in a loop must not disturb unrelated work in the same
iteration, and clearing a gate must not let a rerun gate redo a progression that
later iterations already followed. The clear API therefore takes two controls
that default on: clear downstream, and clear later loop iterations. Rerunning a
gate while later iterations remain leaves them alone, because a second decision
for the same iteration would fork history with nothing to attribute it to.
Replaced generated work leaves the live set by being retired in place, so its
tries, logs, XCom and notes stay attached to the attempt that produced them,
and the work that replaces it is created in a new region instead of reoccupying
the old coordinates. Ordinary tasks still get a successor try in their existing
region. A pre-region mapped expansion has no region record, so a whole-task
clear mints one rather than rewriting the sentinel rows.
We cannot retire a row that is still terminating from the clear transaction
alone: the supervisor's completion report decides how the row ends. Clears,
executor events, the heartbeat scan and gate completion therefore take the
DagRun lock before any task instance lock, so they cannot interleave in opposite
orders and deadlock. Rows that never started are retired without being stamped
FAILED, so their state still says they never ran.
When the scheduler skips an executor event's task instance row because another
transaction holds its lock, it requeues the event, as it does when the DagRun is
locked. Dropping it would leave the attempt unreported. The event is discarded
only once the row is gone or retired, and a requeued event is not counted as
processed, so a held lock neither inflates the metrics nor keeps the scheduler
loop from sleeping.1 parent 0d3ae91 commit 56f29f5
36 files changed
Lines changed: 5371 additions & 266 deletions
File tree
- airflow-core
- src/airflow
- api_fastapi
- core_api
- datamodels
- openapi
- routes/public
- services/public
- execution_api/routes
- cli/commands
- jobs
- models
- serialization/definitions
- ui
- openapi-gen
- queries
- requests
- src/components
- MarkAs/TaskInstance
- tests/unit
- api_fastapi
- core_api/routes/public
- execution_api/versions/head
- cli/commands
- jobs
- models
- airflow-ctl
- src/airflowctl
- api/datamodels
- ctl
- tests/airflow_ctl/ctl
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
| |||
239 | 242 | | |
240 | 243 | | |
241 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
242 | 258 | | |
243 | 259 | | |
244 | 260 | | |
| |||
281 | 297 | | |
282 | 298 | | |
283 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
284 | 313 | | |
285 | 314 | | |
286 | 315 | | |
287 | 316 | | |
288 | 317 | | |
| 318 | + | |
| 319 | + | |
289 | 320 | | |
290 | 321 | | |
291 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4975 | 4975 | | |
4976 | 4976 | | |
4977 | 4977 | | |
| 4978 | + | |
| 4979 | + | |
| 4980 | + | |
| 4981 | + | |
| 4982 | + | |
| 4983 | + | |
| 4984 | + | |
4978 | 4985 | | |
4979 | 4986 | | |
4980 | 4987 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7540 | 7540 | | |
7541 | 7541 | | |
7542 | 7542 | | |
| 7543 | + | |
| 7544 | + | |
| 7545 | + | |
| 7546 | + | |
| 7547 | + | |
| 7548 | + | |
| 7549 | + | |
| 7550 | + | |
| 7551 | + | |
| 7552 | + | |
| 7553 | + | |
| 7554 | + | |
| 7555 | + | |
| 7556 | + | |
| 7557 | + | |
| 7558 | + | |
| 7559 | + | |
7543 | 7560 | | |
7544 | 7561 | | |
7545 | 7562 | | |
| |||
8505 | 8522 | | |
8506 | 8523 | | |
8507 | 8524 | | |
| 8525 | + | |
| 8526 | + | |
| 8527 | + | |
| 8528 | + | |
| 8529 | + | |
| 8530 | + | |
| 8531 | + | |
| 8532 | + | |
| 8533 | + | |
| 8534 | + | |
| 8535 | + | |
| 8536 | + | |
| 8537 | + | |
| 8538 | + | |
| 8539 | + | |
| 8540 | + | |
| 8541 | + | |
8508 | 8542 | | |
8509 | 8543 | | |
8510 | 8544 | | |
| |||
9543 | 9577 | | |
9544 | 9578 | | |
9545 | 9579 | | |
| 9580 | + | |
| 9581 | + | |
| 9582 | + | |
| 9583 | + | |
| 9584 | + | |
| 9585 | + | |
| 9586 | + | |
| 9587 | + | |
| 9588 | + | |
| 9589 | + | |
| 9590 | + | |
| 9591 | + | |
| 9592 | + | |
| 9593 | + | |
| 9594 | + | |
| 9595 | + | |
| 9596 | + | |
9546 | 9597 | | |
9547 | 9598 | | |
9548 | 9599 | | |
| |||
9621 | 9672 | | |
9622 | 9673 | | |
9623 | 9674 | | |
| 9675 | + | |
| 9676 | + | |
| 9677 | + | |
| 9678 | + | |
| 9679 | + | |
| 9680 | + | |
| 9681 | + | |
| 9682 | + | |
| 9683 | + | |
| 9684 | + | |
| 9685 | + | |
| 9686 | + | |
| 9687 | + | |
| 9688 | + | |
| 9689 | + | |
| 9690 | + | |
| 9691 | + | |
9624 | 9692 | | |
9625 | 9693 | | |
9626 | 9694 | | |
| |||
9658 | 9726 | | |
9659 | 9727 | | |
9660 | 9728 | | |
| 9729 | + | |
| 9730 | + | |
| 9731 | + | |
| 9732 | + | |
| 9733 | + | |
| 9734 | + | |
9661 | 9735 | | |
9662 | 9736 | | |
9663 | 9737 | | |
| |||
9711 | 9785 | | |
9712 | 9786 | | |
9713 | 9787 | | |
| 9788 | + | |
| 9789 | + | |
| 9790 | + | |
| 9791 | + | |
| 9792 | + | |
| 9793 | + | |
| 9794 | + | |
| 9795 | + | |
| 9796 | + | |
| 9797 | + | |
| 9798 | + | |
| 9799 | + | |
| 9800 | + | |
| 9801 | + | |
| 9802 | + | |
| 9803 | + | |
| 9804 | + | |
9714 | 9805 | | |
9715 | 9806 | | |
9716 | 9807 | | |
| |||
9748 | 9839 | | |
9749 | 9840 | | |
9750 | 9841 | | |
| 9842 | + | |
| 9843 | + | |
| 9844 | + | |
| 9845 | + | |
| 9846 | + | |
| 9847 | + | |
9751 | 9848 | | |
9752 | 9849 | | |
9753 | 9850 | | |
| |||
9801 | 9898 | | |
9802 | 9899 | | |
9803 | 9900 | | |
| 9901 | + | |
| 9902 | + | |
| 9903 | + | |
| 9904 | + | |
| 9905 | + | |
| 9906 | + | |
| 9907 | + | |
| 9908 | + | |
| 9909 | + | |
| 9910 | + | |
| 9911 | + | |
| 9912 | + | |
| 9913 | + | |
| 9914 | + | |
| 9915 | + | |
| 9916 | + | |
| 9917 | + | |
9804 | 9918 | | |
9805 | 9919 | | |
9806 | 9920 | | |
| |||
9838 | 9952 | | |
9839 | 9953 | | |
9840 | 9954 | | |
| 9955 | + | |
| 9956 | + | |
| 9957 | + | |
| 9958 | + | |
| 9959 | + | |
| 9960 | + | |
9841 | 9961 | | |
9842 | 9962 | | |
9843 | 9963 | | |
| |||
12827 | 12947 | | |
12828 | 12948 | | |
12829 | 12949 | | |
| 12950 | + | |
| 12951 | + | |
| 12952 | + | |
| 12953 | + | |
| 12954 | + | |
| 12955 | + | |
| 12956 | + | |
| 12957 | + | |
| 12958 | + | |
| 12959 | + | |
| 12960 | + | |
12830 | 12961 | | |
12831 | 12962 | | |
12832 | 12963 | | |
| |||
13206 | 13337 | | |
13207 | 13338 | | |
13208 | 13339 | | |
| 13340 | + | |
| 13341 | + | |
| 13342 | + | |
| 13343 | + | |
| 13344 | + | |
| 13345 | + | |
| 13346 | + | |
| 13347 | + | |
| 13348 | + | |
| 13349 | + | |
| 13350 | + | |
| 13351 | + | |
| 13352 | + | |
| 13353 | + | |
| 13354 | + | |
| 13355 | + | |
| 13356 | + | |
| 13357 | + | |
| 13358 | + | |
| 13359 | + | |
| 13360 | + | |
| 13361 | + | |
| 13362 | + | |
| 13363 | + | |
13209 | 13364 | | |
13210 | 13365 | | |
13211 | 13366 | | |
| |||
16115 | 16270 | | |
16116 | 16271 | | |
16117 | 16272 | | |
| 16273 | + | |
| 16274 | + | |
| 16275 | + | |
| 16276 | + | |
| 16277 | + | |
| 16278 | + | |
| 16279 | + | |
| 16280 | + | |
| 16281 | + | |
| 16282 | + | |
| 16283 | + | |
16118 | 16284 | | |
16119 | 16285 | | |
16120 | 16286 | | |
| |||
16964 | 17130 | | |
16965 | 17131 | | |
16966 | 17132 | | |
| 17133 | + | |
| 17134 | + | |
| 17135 | + | |
| 17136 | + | |
| 17137 | + | |
| 17138 | + | |
| 17139 | + | |
16967 | 17140 | | |
16968 | 17141 | | |
16969 | 17142 | | |
| |||
0 commit comments