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 2021/08/21 10:38:15 UTC

[GitHub] [airflow] hbrls opened a new pull request #14535: Fix: Mysql 5.7 id utf8mb3

hbrls opened a new pull request #14535:
URL: https://github.com/apache/airflow/pull/14535


   This may not be a ready PR. The code diff best expresses my ideas.
   
   I'm initializing a mysql 5.7 db from empty using `hub.docker.com, apache/airflow:2.0.1-python3.8`. The migration scripts throw errors of `(1071, 'Specified key was too long; max key length is 767 bytes')`. `AIRFLOW__CORE__SQL_ENGINE_COLLATION_FOR_IDS: utf8mb3_general_ci` does not work. (ref #7570).
   
   After go through the issues and code, I had an assumption that `utf8mb3` config was not applied to all places that it should. I applied those migration scripts manually, then it works.
   
   I'm not confident about how the migration scripts work.
   
   1. Should it be generated by some tools and not modified manually?
   2. Some scripts modify existed columns. Can I directly fix the `create table` scripts and skip the `modify table` ones? How does this affect the old users wants to upgrade?
   
   ~~Another question.~~
   
   ~~I cannot fix the line `bop.create_primary_key('pk_xcom', ['dag_id', 'task_id', 'key', 'execution_date'])`. My DBA always told me not to use too many columns for keys. Why in this case `dag_id` and `task_id` is not enough?~~
   
   EDIT: Fixed in master.


-- 
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] kurtqq commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   migration scripts are created with alembic.
   you should change the target branch to Master.


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

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



[GitHub] [airflow] potiuk merged pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   


-- 
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] hbrls commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   The docker image `apache/airflow:2.0.1-python3.8` on dockerhub.com is quite behind master, which fixed some of the sql. Would you please release a newer tag?


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

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



[GitHub] [airflow] hbrls commented on a change in pull request #14535: Fix: Mysql 5.7 id utf8mb3

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



##########
File path: airflow/migrations/versions/e3a246e0dc1_current_schema.py
##########
@@ -38,6 +38,8 @@
 depends_on = None
 
 
+print(COLLATION_ARGS)

Review comment:
       Yes, that's for debug. I will revert the line.

##########
File path: airflow/migrations/versions/bbf4a7ad0465_remove_id_column_from_xcom.py
##########
@@ -110,7 +110,8 @@ def upgrade():
             bop.drop_index('idx_xcom_dag_task_date')
             # mssql doesn't allow primary keys with nullable columns
             if conn.dialect.name != 'mssql':
-                bop.create_primary_key('pk_xcom', ['dag_id', 'task_id', 'key', 'execution_date'])
+                #bop.create_primary_key('pk_xcom', ['dag_id', 'task_id', 'key', 'execution_date'])
+                bop.create_primary_key('pk_xcom', ['dag_id', 'task_id', 'key'])

Review comment:
       My mysql throws when creating the PK longer than 700. I have no idea how to fix it properly.
   
   But since it's not related to utf8mb3,I will revert this line.




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

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



[GitHub] [airflow] github-actions[bot] closed pull request #14535: Fix: Mysql 5.7 id utf8mb3

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #14535:
URL: https://github.com/apache/airflow/pull/14535


   


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

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



[GitHub] [airflow] hbrls commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   > Would you please rebase to latest `main` @hbrls ?
   
   Done.


-- 
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] siddharthvp commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   Should this have been closed? This does indeed seem to be an issue and the patch would likely help with MariaDB compatibility as well (#16907).


-- 
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] boring-cyborg[bot] commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #14535:
URL: https://github.com/apache/airflow/pull/14535#issuecomment-787603756


   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (flake8, pylint and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/master/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/master/docs/apache-airflow/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/master/BREEZE.rst) for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#coding-style-and-best-practices).
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


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

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



[GitHub] [airflow] hbrls commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   Is it closed? I've rebased the fixes.


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

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



[GitHub] [airflow] github-actions[bot] commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   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.

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



[GitHub] [airflow] potiuk commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   I think you still have static checks problem. Again, I hearltily recommend installing pre-commits and running them locally on your changes before pushing (if you install and use pre-commit it will happen automatically - you won't be able to commit until the tests pass. It saves a lot of time for iteration - for both you, and committers looking at your change)


-- 
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] potiuk commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   @hbrls - do you still want to rebase and merge this one? We are also just about to merge the #17729 to automatically default to utf8mb3 for MySQL (and mariadb) and I think it would be worthwile to add the collation to ids. or if not @siddharthvp maybe you would like to take that over and lead to completion?


-- 
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] closed pull request #14535: Fix: Mysql 5.7 id utf8mb3

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #14535:
URL: https://github.com/apache/airflow/pull/14535


   


-- 
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] mik-laj commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #14535:
URL: https://github.com/apache/airflow/pull/14535#issuecomment-856398136


   It looks like a bug. I reopened this PR. 


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

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



[GitHub] [airflow] github-actions[bot] commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   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



[GitHub] [airflow] github-actions[bot] commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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] hbrls commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   I'm working on the rebase to master. Sorry for false triggers.


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

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



[GitHub] [airflow] uranusjr commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   There is a schedule to those; the next release will happen next week, if I understand correctly.


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

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



[GitHub] [airflow] boring-cyborg[bot] commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #14535:
URL: https://github.com/apache/airflow/pull/14535#issuecomment-904641675


   Awesome work, congrats on your first merged pull request!
   


-- 
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] hbrls commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   @potiuk I've fixed the comment position. And rebased to latest main.


-- 
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] potiuk commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   Would you please rebase to latest `main` @hbrls ? 


-- 
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] potiuk commented on a change in pull request #14535: Fix: Mysql 5.7 id utf8mb3

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



##########
File path: airflow/migrations/versions/e3a246e0dc1_current_schema.py
##########
@@ -38,6 +38,8 @@
 depends_on = None
 
 
+print(COLLATION_ARGS)

Review comment:
       I guess we shoudl remove it ?

##########
File path: airflow/migrations/versions/bbf4a7ad0465_remove_id_column_from_xcom.py
##########
@@ -110,7 +110,8 @@ def upgrade():
             bop.drop_index('idx_xcom_dag_task_date')
             # mssql doesn't allow primary keys with nullable columns
             if conn.dialect.name != 'mssql':
-                bop.create_primary_key('pk_xcom', ['dag_id', 'task_id', 'key', 'execution_date'])
+                #bop.create_primary_key('pk_xcom', ['dag_id', 'task_id', 'key', 'execution_date'])
+                bop.create_primary_key('pk_xcom', ['dag_id', 'task_id', 'key'])

Review comment:
       Why this




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

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



[GitHub] [airflow] siddharthvp commented on a change in pull request #14535: Fix: Mysql 5.7 id utf8mb3

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



##########
File path: airflow/migrations/versions/03afc6b6f902_increase_length_of_fab_ab_view_menu_.py
##########
@@ -29,6 +29,8 @@
 from sqlalchemy.engine.reflection import Inspector
 
 # revision identifiers, used by Alembic.
+from airflow.models.base import COLLATION_ARGS

Review comment:
       This line should go above the comment. In other files as well.




-- 
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] hbrls commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   I've done the pre-commit except `_build_images.sh`. I guess it's ok now.


-- 
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] potiuk commented on pull request #14535: Fix: Mysql 5.7 id utf8mb3

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


   Some static check failed. Highly recommend installing pre-commits: https://github.com/apache/airflow/blob/main/STATIC_CODE_CHECKS.rst#pre-commit-hooks


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