You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Lee-W (via GitHub)" <gi...@apache.org> on 2024/08/13 11:10:06 UTC

[PR] Fetch history dataset events based on DDRQ instead of the previous Dag Run [airflow]

Lee-W opened a new pull request, #41427:
URL: https://github.com/apache/airflow/pull/41427

   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fetch history dataset events based on DDRQ instead of the previous Dag Run [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on PR #41427:
URL: https://github.com/apache/airflow/pull/41427#issuecomment-2287881763

   > I thought of it but I would
   
   Is this sentence unfinished?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fetch history dataset events based on DDRQ instead of the previous Dag Run [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #41427:
URL: https://github.com/apache/airflow/pull/41427#issuecomment-2286015380

   cc @uranusjr @dstandish 
   
   I'll add some tests to this one, but it would be great if you could take a look. Thanks!


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fetch history dataset events based on DDRQ instead of the previous Dag Run [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #41427: Fetch history dataset events based on DDRQ instead of the previous Dag Run
URL: https://github.com/apache/airflow/pull/41427


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fetch history dataset events based on DDRQ instead of the previous Dag Run [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #41427:
URL: https://github.com/apache/airflow/pull/41427#issuecomment-2293149861

   > This is not _that_ difficult to understand, at least when isolated like in this PR, but I agree with Daniel this may not be easy to follow otherwise. It is a bit too implicit to my liking.
   > 
   > How much work do you this would be neded to produced a POC for the explicit association solution? We don’t have a tight deadline on this since this will be in 2.10.1 the earliest, which is still some time away.
   
   I think I should be able to have a POC early next week.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fetch history dataset events based on DDRQ instead of the previous Dag Run [airflow]

Posted by "uranusjr (via GitHub)" <gi...@apache.org>.
uranusjr commented on PR #41427:
URL: https://github.com/apache/airflow/pull/41427#issuecomment-2293082576

   This is not _that_ difficult to understand, at least when isolated like in this PR, but I agree with Daniel this may not be easy to follow otherwise. It is a bit too implicit to my liking.
   
   How much work do you this would be neded to produced a POC for the explicit association solution? We don’t have a tight deadline on this since this will be in 2.10.1 the earliest, which is still some time away.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fetch history dataset events based on DDRQ instead of the previous Dag Run [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #41427:
URL: https://github.com/apache/airflow/pull/41427#issuecomment-2287944972

   > > I thought of it but I would
   > 
   > Is this sentence unfinished?
   
   I've reworded it and didn't remove this sentence. Just updated it. Thanks!


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fetch history dataset events based on DDRQ instead of the previous Dag Run [airflow]

Posted by "dstandish (via GitHub)" <gi...@apache.org>.
dstandish commented on PR #41427:
URL: https://github.com/apache/airflow/pull/41427#issuecomment-2286644077

   The timestamp-based filtering is hard to reason about and, sorta imprecise.  Maybe we should take this opportunity to explore using parent-child relationships that don't rely on timestamps.
   
   By that I mean, when a dataset event results in a queue record, stamp the association in a table.
   
   So like add surrogate key autoincrementing integer `id` column to DDRQ, then...
   when dataset event results in ddrq creation, then we create the ddrq record and create a record in a mapping table (ddrq_id, dataset_event_id)
   
   Then we'd be able to know the association precisely.
   
   The challenge though is that we have have to deal with many concurrent writers.  There is a race condition when creating the DDRQ record, and there's another one when the DDRQ record is "consumed".  So we would have to deal with that.
   
   Given that challenge and complexity, and since timestamp comparision was "good enough", I did not go that route initially.  But curious what y'all think.  Is it worth exploring?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fetch history dataset events based on DDRQ instead of the previous Dag Run [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #41427:
URL: https://github.com/apache/airflow/pull/41427#issuecomment-2287711473

   > The timestamp-based filtering is hard to reason about and, sorta imprecise. Maybe we should take this opportunity to explore using parent-child relationships that don't rely on timestamps.
   > 
   > By that I mean, when a dataset event results in a queue record, stamp the association in a table.
   > 
   > So like add surrogate key autoincrementing integer `id` column to DDRQ, then... when dataset event results in ddrq creation, then we create the ddrq record and create a record in a mapping table (ddrq_id, dataset_event_id)
   > 
   > Then we'd be able to know the association precisely.
   > 
   > The challenge though is that we have have to deal with many concurrent writers. There is a race condition when creating the DDRQ record, and there's another one when the DDRQ record is "consumed". So we would have to deal with that.
   > 
   > Given that challenge and complexity, and since timestamp comparision was "good enough", I did not go that route initially. But curious what y'all think. Is it worth exploring?
   
   I thought of it but I would 
   
   > The timestamp-based filtering is hard to reason about and, sorta imprecise. Maybe we should take this opportunity to explore using parent-child relationships that don't rely on timestamps.
   > 
   > By that I mean, when a dataset event results in a queue record, stamp the association in a table.
   > 
   > So like add surrogate key autoincrementing integer `id` column to DDRQ, then... when dataset event results in ddrq creation, then we create the ddrq record and create a record in a mapping table (ddrq_id, dataset_event_id)
   > 
   > Then we'd be able to know the association precisely.
   > 
   > The challenge though is that we have have to deal with many concurrent writers. There is a race condition when creating the DDRQ record, and there's another one when the DDRQ record is "consumed". So we would have to deal with that.
   > 
   > Given that challenge and complexity, and since timestamp comparision was "good enough", I did not go that route initially. But curious what y'all think. Is it worth exploring?
   
   I have considered it, but I might sugest we keep it as it is for now. The original previous DAG run method has already resolved most scenarios. This rare case, where the previous DAG run is removed, was only discovered long after this feature was introduced. This PR should be able to move us one step forward.
   
   In our current design, directly linking DDRQ and dataset events might introduce more complexity even before the race condition you mentioned. Also, we are now redesigning datasets as assets. If we're to explore the new way, we probably should do that during the assets change. What do you think?


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fetch history dataset events based on DDRQ instead of the previous Dag Run [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #41427:
URL: https://github.com/apache/airflow/pull/41427#issuecomment-2451055863

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org