Uh oh!
There was an error while loading. Please reload this page.
[AIRFLOW-5771] Straighten out alembic migrations - #6442
Conversation
Fokko
commented
Oct 27, 2019
PTAL @dstandish |
bolkedebruin
commented
Oct 27, 2019
Sorry @Fokko nitpicking: can you ensure the reason for the change is in the commit message? And is an empty upgrade really the way to fix this? It looks... Dirty. Was AIP-24 already in a release? |
cd439a1 to
7e5018bCompareFokko
commented
Oct 27, 2019
@bolkedebruin Thanks. As we say in Dutch: feedback is een cadeautje. I've updated @kaxil's migration to add the other head as well, which also solved the issue. I've updated commit and the description. |
Fokko
commented
Oct 27, 2019
Codecov Report
@@ Coverage Diff @@## master #6442 +/- ##
==========================================
- Coverage 83.85% 83.67% -0.18%
==========================================
Files 627 627 Lines 36537 36537 ==========================================
- Hits 30639 30574 -65 - Misses 5898 5963 +65
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Haha I didnt even know that is possible :-)
There was a problem hiding this comment.
But can't we adjust the head of AIP-24 btw? That would not make the double reference required?
There was a problem hiding this comment.
If we change the head of AIP-24, then we detach another head.
There was a problem hiding this comment.
The alembic migrations are a DAG as well :-)
bolkedebruin
commented
Oct 27, 2019
I would leave the result out of the commit message (the 'before' 'after' stuff, I dont consider that required) |
kaxil
commented
Oct 27, 2019
AIP-24 is not part of 1.10.6 so updating head should be fine :) |
Remove branchpoints to make it lineair again.
7e5018b to
a3fda6bCompareFokko
commented
Oct 27, 2019
Updated the earlier unreleased migrations to get everything linear again. So we don't have to merge again from any branchpoints. |
ashb
commented
Oct 27, 2019
I'm not quite sure when we might actually want to have multiple heads? If there is never a case Airflow would want this then is it worth adding a unit test (like we have to ensure model and migrations are in sync) to ensure there is just one head? |
Fokko
commented
Oct 27, 2019
We never want to have multiple heads. But sometimes it happens when someone works on a (long running) feature, and from a single revision, two migrations are being branched. For simplicity, you never want to have multiple heads I'd say. @dstandish suggested adding the following unit test: https://blog.jerrycodes.com/multiple-heads-in-alembic-migrations/. This one will detect when we have multiple heads, and fail. |
kaxil
commented
Oct 27, 2019
Yes we should have that unit test and this is going to be a common thing as we would all be now working on big 2.0 features |
Fokko
commented
Oct 27, 2019
Dutch idiom: I don't want to mow the grass in front of @dstandish 's feet. As in, I would like to give him the opportunity to add the test himself :-) |
kaxil
commented
Oct 27, 2019
Haha, I like the idiom |
dstandish
commented
Oct 27, 2019
Haha ok I'll add 😊 |
dstandish
commented
Oct 27, 2019
feluelle
left a comment
There was a problem hiding this comment.
LGTM. I am also for having tests there to check for multiple heads.
P.S. Great blog post btw.
potiuk
left a comment
There was a problem hiding this comment.
LGTM. I am happy to cherry-pick it to 1.10.* for 1.10.7 possibly :)
Fokko
commented
Oct 27, 2019
Thanks @potiuk and @feluelle for the review. I think we should CP this one and #6449 onto the 1.10.x branch. If you feel like doing it @potiuk, feel free, but it might be tricky since the hashes are different over there. It might be better to just resolve it over there based on the output of |
potiuk
commented
Oct 28, 2019
Yeah. I will cherry-pick (or redo ;) ) both PRs. I am now working on cherry-picking kind-related changes after 1.10.6 is released so I will add those two. |
mattinbits
commented
Nov 22, 2019
Doesn't rewriting the lineage in this way create a problem for anyone who has already deployed a released version which contains the multiple heads, such as 1.10.5? Multiple heads leads to multiple rows in the |
mattinbits
commented
Nov 22, 2019
Further - just tried doing an upgrade to 1.10.6 followed by an upgrade to master: Result is I think this demonstrates the issue. |
kaxil
commented
Nov 22, 2019
@mattinbits Yes, you are right. This PR needs to sync up with what we have in v1-10-test branch too. Can you please test if you can upgrade from 1.10.6 to 1.10.7 successfully? |
mattinbits
commented
Nov 22, 2019
I don't find 1.10.7, does it have a tag? |
kaxil
commented
Nov 22, 2019
Whoops, I mean https://github.com/apache/airflow/tree/v1-10-test branch |
mattinbits
commented
Nov 22, 2019
I get So it looks good |
kaxil
commented
Nov 22, 2019
Thanks, I will check and fix this on master, thanks @mattinbits . |
Due to parallel work, we have split heads in the alembic migrations.
Before:
After:
This reverts the work of #6362 and just makes the migrations linear instead of having branches.
Make sure you have checked all steps below.
Jira
Description
Tests
Commits
Documentation