You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/24 14:19:25 UTC

[GitHub] [airflow] ashb opened a new pull request #21061: (Re)fix Dangling rows moving with MySQL+Replication

ashb opened a new pull request #21061:
URL: https://github.com/apache/airflow/pull/21061


   Splitting this CREATE TABLE AS SELECT query into two queries (CREATE TABLE LIKE .. followed by INSERT INTO) because the former doesn't play nicely with MySQL when replication is enabled
   
   This re-introduces the change from #19999 that I mistakenly removed in my refactor in #19808.
   
   There aren't automatic tests for this as a) it's hard to set up, b) this code isn't touched very often anyway, and c) we don't have replicated MySQL in our tests either. So it's very unlikely this will happen again.
   
   
   <!--
   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 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/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+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 [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.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: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] ashb commented on pull request #21061: (Re)fix Dangling rows moving with MySQL+Replication

Posted by GitBox <gi...@apache.org>.
ashb commented on pull request #21061:
URL: https://github.com/apache/airflow/pull/21061#issuecomment-1020179428


   /cc @SamWheating re-introducing your change that I mistakenly removed. D'oh!


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



[GitHub] [airflow] jedcunningham commented on a change in pull request #21061: (Re)fix Dangling rows moving with MySQL+Replication

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on a change in pull request #21061:
URL: https://github.com/apache/airflow/pull/21061#discussion_r790929956



##########
File path: airflow/utils/db.py
##########
@@ -860,8 +860,15 @@ def _move_dangling_data_to_new_table(
         cte_sql = stmt.ctes[cte]
 
         session.execute(f"WITH {cte_sql} SELECT source.* INTO {target_table_name} FROM source")
+    elif dialect_name == "mysql":
+        # MySQL when replcation is turned needs this split in to two queries, so just do it for all MySQL

Review comment:
       ```suggestion
           # MySQL with replication needs this split in to two queries, so just do it for all MySQL
   ```
   
   nit




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



[GitHub] [airflow] ashb merged pull request #21061: (Re)fix Dangling rows moving with MySQL+Replication

Posted by GitBox <gi...@apache.org>.
ashb merged pull request #21061:
URL: https://github.com/apache/airflow/pull/21061


   


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



[GitHub] [airflow] ashb merged pull request #21061: (Re)fix Dangling rows moving with MySQL+Replication

Posted by GitBox <gi...@apache.org>.
ashb merged pull request #21061:
URL: https://github.com/apache/airflow/pull/21061


   


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



[GitHub] [airflow] github-actions[bot] commented on pull request #21061: (Re)fix Dangling rows moving with MySQL+Replication

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #21061:
URL: https://github.com/apache/airflow/pull/21061#issuecomment-1020292247






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