关于气流CLI清除命令的困惑

时间:2019-06-18 11:51:42

标签: airflow airflow-scheduler

在ubuntu 14.04 CTS上使用气流1.10.3时,我发现了两个令人困惑的问题,请您澄清一下!

  1. 关于明确的参数-s和-e,日期范围是否包括-e date? [s,e)或[s,e]哪一个是正确的?让我们看看第一个[s,e)情况。

气流清除test_send_mail -s 20190607 -e 20190607 输出为:

[2019-06-18 19:07:20,213] {settings.py:182} INFO - settings.configure_orm(): Using pool settings. pool_size=5, pool_recycle=1800, pid=22414

[2019-06-18 19:07:20,318] {__init__.py:51} INFO - Using executor LocalExecutor

Nothing to clear.

但是它确实在20190607上运行了。 气流清除test_send_mail -s 20190607 -e 20190608 输出为:

[2019-06-18 19:16:21,565] {settings.py:182} INFO - settings.configure_orm(): Using pool settings. pool_size=5, pool_recycle=1800, pid=25022

[2019-06-18 19:16:21,663] {__init__.py:51} INFO - Using executor LocalExecutor

You are about to delete these 3 tasks:
<TaskInstance: test_send_mail.mifidw_loan_market_partner_startup 2019-06-07 06:30:00+00:00 [success]>
<TaskInstance: test_send_mail.send_mail_for_mifidw_loan_market_contract_completion1 2019-06-07 06:30:00+00:00 [success]>
<TaskInstance: test_send_mail.send_mail_for_mifidw_loan_market_contract_completion2 2019-06-07 06:30:00+00:00 [success]>

Are you sure? (yes/no):

现在让我们看看另一种情况[s,e]。 气流清除教程1 -s 20190607 -e 20190607 输出为:

[2019-06-18 19:22:43,768] {settings.py:182} INFO - settings.configure_orm(): Using pool settings. pool_size=5, pool_recycle=1800, pid=26819

[2019-06-18 19:22:43,865] {__init__.py:51} INFO - Using executor LocalExecutor

You are about to delete these 3 tasks:
<TaskInstance: tutorial1.print_date 2019-06-07 00:00:00+00:00 [success]>
<TaskInstance: tutorial1.sleep 2019-06-07 00:00:00+00:00 [success]>
<TaskInstance: tutorial1.templated 2019-06-07 00:00:00+00:00 [success]>

Are you sure? (yes/no): 

那么清除CLI会不会是一个错误?

我还发现了一件奇怪的东西。我在20190531上有一个由'airflow trigger'CLI命令创建的dagrun,但无法在 'airflow clear tutorial1 -s 2019-05-30 -e 2019-06-01'的clear命令中列出 ,输出为:

airflow clear tutorial1 -s 2019-05-30 -e 2019-06-01
[2019-06-18 20:23:29,126] {settings.py:182} INFO - settings.configure_orm(): Using pool settings. pool_size=5, pool_recycle=1800, pid=13561
[2019-06-18 20:23:29,222] {__init__.py:51} INFO - Using executor LocalExecutor
You are about to delete these 3 tasks:
<TaskInstance: tutorial1.print_date 2019-06-01 00:00:00+00:00 [success]>
<TaskInstance: tutorial1.sleep 2019-06-01 00:00:00+00:00 [success]>
<TaskInstance: tutorial1.templated 2019-06-01 00:00:00+00:00 [success]>

Are you sure? (yes/no):

它在dag_run表中的​​位置:    enter image description here

  1. 关于清除由回填命令创建的dagrun。我试图运行以下命令:airflow clear test_send_mail -s 20190601 -e 20190602

    在运行它之前,dag_run表中有2个dagrun,日期为20190601,一个run_id的前缀为“ backfill”,另一个run_id的前缀为“ manual”: enter image description here

    当我运行以上命令时,其run_id以'backfill'开头的dagrun一直运行无止境,似乎有些奇怪。这是dag_run表中的​​状态:

    enter image description here

    这是预期的行为吗? clear命令不能在由backfill命令创建的现有旧dagrun上使用?

0 个答案:

没有答案