-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v3] Migrations backwards compatibility #1189
Comments
I must confess that I get totally confused by naming the migrations now. In the contributing docs we say "xx.yy.zz is the number of the latest released version of Procrastinate" and in the migrations docs "you want to update to Procrastinate 1.15.0 ... migration scripts whose versions are greater than or equal to 1.9.0, and lower than 1.15.0". But then in the above table and #1186 you name the migration 03.00.00_01_cancel_notification.sql which won't be lower when we include this migration in a 3.0 release. |
It is confusing :( For v3, you're right that the move I make is probably wrong but the migration was named for 2.9.2 which is also wrong. The reality is that:
We should definitely run the tests with the DB on the previous schema to enforce this, otherwise it's probably prone to wishful thinking. I sometimes wonder if it's worth using procedures at all, compared to doing everything in the queries, but that's a whole other debate. |
Sorry, I am still a bit confused 😞. So with #1186 we will do it the other way around than
because
If the migration will be part of v3.0, wouldn't it be more congruent to check the latest v2.x version (straight before the release) and name it that way? But maybe I take care of those other open issues for v3 and just watch and learn what you do with this issue here 😉.
And all those triggers that use them? |
Haha you seem to think I have it all thought through and I have a plan. I'm learning as I go, and what I've learnt so far is that if you say there's something strange, I better get looking, because you've shown an excellent gut feeling for those issues so far :)
I believe the set of procedures used by triggers is quite distinct from the set of "business-logic" procedures, the former aren't very complex (save |
I'm curious how this is supposed to work with all the changes in the database schema. Can't we justify the service interruption with a major release and the breaking changes (I really regret introducing that |
Usually, it's about making the schema support 2 versions:
This made sense for procrastinate at the time we did it partly because we didn't imagine there would be a lot of migrations, partly because it was the way we did things. I can see that it's really annoying to everyone now.
The process was supposed to help users do blue-green deployments even on major releases. If it happens that we can't it means we designed the process badly 😅
Don't be. Process shouldn't get in the way of improving the lib. This highlights that we need to change the process. But all this discussion is also about how we can change it without it being just annoying for users who can't afford breaking compatibility easily. There will be (hopefully very few, realistically at least some) places where, upon reading that deployment needs to shut off the service, people will schedule it off-hours (evening or weekend). I know because I've been in those kind of situations. As much as I'd appreciate that this kind of practice doesn't exist, as a lib maintainer, I want to make sure that I don't have other people sacrifice their time because I didn't make the effort to make the lib blue-green deployable. It doesn't mean we have to do the impossible, but at least try and see if it's actually easy or not.
In the beginning, they had. and then we got it wrong multiple times because when we did the PR, we didn't know if the next release would be a minor or an incremental. |
I'm going to make a PR to try and fix this mess. It's long overdue. |
According to our own doc, migrations named with version X are the migrations you can apply once you run on version X.
According to our doc, people on v2.13 wishing to upgrade without disruption would:
All the while their instance is running and processing jobs.
Compatibility matrix:
⬇️ Schema
❌ means we don't have to make it compatible, but if it happens to be, it's not a problem, of course
We need to decide what we put in v3.0 and v3.1
Note: the change of
status = aborting -> abort_requested
might need a couple of trigger just for the time of the dual compatibility (adding the `abort_requested column and update its value based on the status, then add a trigger that synchronizes the 2 columns, and in the next release, delete the triggers and the column)The text was updated successfully, but these errors were encountered: