Page MenuHomePhabricator

airflow3: data interval length is zero and logical date points to actual time when the dag starts
Closed, ResolvedPublic

Description

On Airflow 2, hourly jobs had Run ID pointing to previous hour, on Airflow 3 they are pointing to a current hour.

Before the upgrade

Run ID scheduled__2026-09-29T07:00:00+00:00
Start Date 2026-09-29 08:00:07
[2026-09-29 08:00:08] [2026-09-29T08:00:08.511+0000] {named_hive_partition.py:94} INFO - Poking for wmf_raw.webrequest/webrequest_source=test_text/year=2026/month=9/day=29/hour=7

After the upgrade

Run ID scheduled__2026-09-29T13:00:00+00:00
Start Date 2026-09-29 13:00:25
[2026-09-29 13:00:32] INFO - Poking for wmf_raw.webrequest/webrequest_source=test_text/year=2026/month=9/day=29/hour=13

Before the upgrade

Run ID scheduled__2026-09-29T09:00:00+00:00
Start Date 2026-09-29 10:00:21
[2026-09-29 10:00:22] [2026-09-29T10:00:22.699+0000] {monitor_s3_dag.py:54} INFO - dag_id=test_s3_connection/run_id=scheduled__2026-09-29T09:00:00+00:00/task_id=test_s3_connection/attempt=1.log was found in S3. All good.

After the upgrade

Run ID scheduled__2026-09-29T15:00:00+00:00
Start Date 2026-09-29 15:00:22
[2026-09-29 15:00:25] INFO - dag_id=test_s3_connection/run_id=scheduled__2026-09-29T15:00:00+00:00/task_id=test_s3_connection/attempt=1.log was found in S3. All good.

It can be the logical date problem or the sensor problem. Another indication is that we are waiting for the partition for one hour longer.

Event Timeline

atsuko renamed this task from airflow3: hive partition sensor logical date is offset by an hour to airflow3: logical date is offset by an hour from airflow 2.Sep 29 2026, 3:42 PM
atsuko updated the task description. (Show Details)
atsuko renamed this task from airflow3: logical date is offset by an hour from airflow 2 to airflow3: logical date is offset by one period in the future in comparison to airflow 2.Sep 29 2026, 3:59 PM

Seems like I found it:

on old runs

Run ID	scheduled__2026-09-29T08:00:00+00:00
Data Interval Start	2026-09-29 08:00:00
Data Interval End	2026-09-29 09:00:00

on new runs:

Run ID	scheduled__2026-09-29T16:00:00+00:00
Data Interval Start	2026-09-29 16:00:00
Data Interval End	2026-09-29 16:00:00
atsuko renamed this task from airflow3: logical date is offset by one period in the future in comparison to airflow 2 to airflow3: data interval length is zero and logical date points to actual time when the dag starts.Sep 29 2026, 4:13 PM
atsuko changed the task status from Open to In Progress.Sep 29 2026, 4:19 PM

After applying scheduler.create_cron_data_intervals: true patch:

Run ID	scheduled__2026-09-29T18:00:00+00:00
Data Interval Start	2026-09-29 17:00:00
Data Interval End	2026-09-29 18:00:00
[2026-09-29 18:00:26] INFO - Poking for wmf_raw.webrequest/webrequest_source=test_text/year=2026/month=9/day=29/hour=17

Run ID is now equals Data Interval End as opposed to Data Interval Start on Airflow 2, however DAGs are getting correct start time. Note that the wait_for_wmf_raw_webrequest_partitions skipped a run.