aprettyloner opened a new issue, #28872:
URL: https://github.com/apache/airflow/issues/28872

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### What happened
   
   # Context
   We performed an upgrade today from 2.2.3 to 2.4.0, with a chart upgrade from 
8.4.1 to 8.6.1.
   
   # Issue Encountered
   The grid UI at `/dags/{dag_id}/grid` endpoint has very unusual display 
behavior.
   
   ## 1. Missing recent dag runs in grid
   This dag has run hourly in production since 2021-08-19. For some reason, the 
grid endpoint is displaying dag runs from January 2022. Even when a dag run is 
in progress, the grid default view still shows old data.
   
   
![image](https://user-images.githubusercontent.com/22802852/211955052-c047abb2-3b7b-411f-91c8-873375271e73.png)
   
   ### Data Mismatch
   
   #### Expected
   
   We would expect to see in the **DAG Runs Summary** table:
   - First Run Start: 2023-01-11, 02:00:09 UTC
   - Last Run Start: 2023-01-12, 02:00:03 UTC
   
   #### Observed
   
   In the **DAG Runs Summary** table, we see:
   - First Run Start: 2022-01-24, 04:00:05 UTC
   - Last Run Start: 2022-01-25, 04:00:04 UTC
   
   This doesn't align with the database for the same query (default 25 most 
recent runs).
   
   
![image](https://user-images.githubusercontent.com/22802852/211957991-577e3e7d-65f1-4e72-b94f-02abddae9403.png)
   
   
   
   ### Workaround
   If and only if a dag is running, then it appears in the grid using the 
`/dags/{dag_id}/grid?run_state=running` endpoint.
   
   
![image](https://user-images.githubusercontent.com/22802852/211955769-a9bad3ea-5bc0-4696-9007-407c86c2ee98.png)
   
   
   ## 2. Peculiar ordering for dag runs in grid
   This dag has been running daily since 2022-01-07. Unlike the above example, 
the recent 2023 dag runs do appear in the grid. However, the ordering is very 
peculiar. We would expect this week's runs to be all the way to the right.
   
   
   
![image](https://user-images.githubusercontent.com/22802852/211956324-6b94b6b3-f026-42fb-8bd1-7fa8e8344316.png)
   
   Runs from 2023-01-07 to 2023-01-12 appear left of first run (2022-01-06, in 
the failed state).
   
   
![image](https://user-images.githubusercontent.com/22802852/211956371-5480b168-d98e-4ac4-ba1e-b4f1a4f0d515.png)
   
   
   #### Expected
   
   We would expect to see in the **DAG Runs Summary** table:
   - First Run Start: 2022-12-19, 00:05:00 UTC
   - Last Run Start: 2023-01-12, 00:05:00 UTC
   
   #### Observed
   
   As above, there is a mismatch in the **DAG Runs Summary** table.
   - First Run Start: 2023-01-07, 00:05:01 UTC <---- Why would "first" be a 
later date? 🤔 🤔 🤔 🤔 🤔 🤔 
   - Last Run Start: 2022-01-25, 00:05:04 UTC
   
   This doesn't align with the database for the same query (default 25 most 
recent runs).
   
   
![image](https://user-images.githubusercontent.com/22802852/211958774-fc377a10-56f3-4f3f-a721-1ad485bab747.png)
   
   
   
   ### What you think should happen instead
   
   # What possibly went wrong
   There seems to be some incorrect date filtering/ordering against the 
database.
   
   # Observations
   
   Interestingly, our stage instance for the same DAG shows recent runs 
correctly and in a logical order. The deployments process, chart configuration, 
and airflow version are identical across our environments.
   
   
![image](https://user-images.githubusercontent.com/22802852/211959047-afeff5c1-37df-4f41-b25d-0bdd5c1fea60.png)
   
   
   ## DAG History
   
   The only discernable difference between behavior is when the dags were first 
turned on.
   
   ### Not missing recent runs
   Staging DAG has run since 2022-05-05
   
   
![image](https://user-images.githubusercontent.com/22802852/211959726-145acc13-b270-4265-821e-494b5bc31ff7.png)
   
   Prod DAG has run since 2022-01-07 - **Note that this one had the additional 
left -> right ordering issue**
   
   
![image](https://user-images.githubusercontent.com/22802852/211960267-f0dc1ba4-00a7-4e24-ae65-2ab4d14c3c75.png)
   
   ### Missing recent runs
   
   Prod DAG has run since 2021-08-19
   
   
![image](https://user-images.githubusercontent.com/22802852/211960399-3520e8a5-9513-44df-a6e1-ce57430edcc2.png)
   
   
   
   
   ### How to reproduce
   
   1. Spin up with 2.4.0 and run multiple dags with varying `start_date` and 
with `catchup` enabled.
   2. Inspect the  `/dags/{dag_id}/grid` endpoint for running dags.
   
   ### Operating System
   
   Debian GNU/Linux - 11 (bullseye)
   
   ### Versions of Apache Airflow Providers
   
   ```
   apache-airflow-providers-amazon          5.1.0
   apache-airflow-providers-celery          3.0.0
   apache-airflow-providers-cncf-kubernetes 4.3.0
   apache-airflow-providers-common-sql      1.3.1
   apache-airflow-providers-docker          3.1.0
   apache-airflow-providers-elasticsearch   4.2.0
   apache-airflow-providers-ftp             3.2.0
   apache-airflow-providers-google          8.3.0
   apache-airflow-providers-grpc            3.0.0
   apache-airflow-providers-hashicorp       3.1.0
   apache-airflow-providers-http            4.1.0
   apache-airflow-providers-imap            3.1.0
   apache-airflow-providers-microsoft-azure 4.2.0
   apache-airflow-providers-mysql           3.2.0
   apache-airflow-providers-odbc            3.1.1
   apache-airflow-providers-pagerduty       3.1.0
   apache-airflow-providers-postgres        5.2.1
   apache-airflow-providers-redis           3.0.0
   apache-airflow-providers-salesforce      5.2.0
   apache-airflow-providers-sendgrid        3.0.0
   apache-airflow-providers-sftp            4.0.0
   apache-airflow-providers-slack           5.1.0
   apache-airflow-providers-sqlite          3.3.1
   apache-airflow-providers-ssh             3.1.0
   ```
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   Deployed on GKE via helm:v3.2.0.
   
   ### Anything else
   
   I am willing to submit a PR but I need to dig into the codebase a bit more.
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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