dheerajturaga commented on code in PR #73763:
URL: https://github.com/apache/airflow/pull/73763#discussion_r4129414041


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/backfills.py:
##########
@@ -44,6 +44,13 @@ class BackfillPostBody(StrictBaseModel):
         "then the ``[core] rerun_with_latest_version`` config option, "
         "and finally ``True`` (the historical default for backfills).",
     )
+    drain_dag: bool = Field(
+        default=False,
+        description="Put the Dag into the draining state so the backfill 
executes without resuming the "
+        "schedule. The Dag pauses once all of its unfinished runs finish, and 
any runs already queued "
+        "on a paused Dag start as well. Requires the same permission as 
pausing the Dag. Ignored by the "

Review Comment:
   Agreed, it shouldn't be a surprise. The only way to start just the new run 
on a paused Dag is a per-run exemption from the pause check, which is what 
#60818 was closed for, and a "paused, but…" path is also what the other thread 
here asks to avoid. So rather than hide the drain, I've made it the headline:
   
   - The option is now called **Drain**: "Queued runs start, but no scheduled 
runs are created. The Dag pauses again once they finish." **Unpause** now says 
"queued runs start" as well, so the two options differ only in whether the 
schedule resumes.
   - When the Dag already has unfinished runs, the form still shows how many 
will start before you submit.
   - The `drain_dag` descriptions, docs and newsfragment now say up front that 
draining changes the whole Dag, not only the new run.
   



##########
airflow-core/docs/core-concepts/dags.rst:
##########
@@ -813,6 +815,16 @@ the scheduler automatically changes the Dag to paused. A 
backfill started while
 the drain until its Dag runs have been created and finished. While a Dag is 
draining, you can cancel the drain
 to make the Dag active again.
 
+To execute a manual run, backfill or asset materialization on a paused Dag 
without resuming its schedule,
+choose **Run without resuming the schedule** in the UI, or set ``drain_dag`` 
to ``true`` in the REST API

Review Comment:
   Agreed. "Run without resuming the schedule" is gone from the UI, docs and 
newsfragment. The option is now **Drain**, and the docs describe it as draining 
the Dag instead of unpausing it, including that queued runs start.
   



##########
airflow-core/docs/core-concepts/dags.rst:
##########
@@ -813,6 +815,16 @@ the scheduler automatically changes the Dag to paused. A 
backfill started while
 the drain until its Dag runs have been created and finished. While a Dag is 
draining, you can cancel the drain
 to make the Dag active again.
 
+To execute a manual run, backfill or asset materialization on a paused Dag 
without resuming its schedule,

Review Comment:
   Updated: the title, docs, newsfragment and the option itself now describe 
draining, with the consequence first ("Drain: Queued runs start, but no 
scheduled runs are created. The Dag pauses again once they finish."). On point 
3, there is no "paused, but…" path: `drain_dag` only moves the Dag to 
`draining` under a row lock (`DagModel.start_drain`). The PR doesn't touch the 
scheduler or add a per-run flag, so a run starts only because the Dag is no 
longer paused.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to