Skip to content

Conversation

@Yopi
Copy link
Contributor

@Yopi Yopi commented Nov 4, 2025

If we have migrations, we can run the API deployment first since it will run the migration. If that succeeds we can deploy the workers, and they will be able to be deployed without any issues with mismatching schemas.

If we have migrations, we can run the API deployment first since it will run the migration.
If that succeeds we can deploy the workers, and they will be able to be deployed without
any issues with mismatching schemas.
@vercel
Copy link

vercel bot commented Nov 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
polar Ignored Ignored Nov 4, 2025 8:21am
polar-sandbox Ignored Ignored Nov 4, 2025 8:21am

@Yopi
Copy link
Contributor Author

Yopi commented Nov 4, 2025

Opened this up for the sake of discussion @frankie567, @psincraian. As I understand it, there's not really a problem in having the workers fail for a few seconds given that they will retry, but it would feel better if we could reduce the noise during a deployment of a migration.

I think this coupled with splitting migrations and code changes as much as we can will make deployments a lot less volatile.

@psincraian
Copy link
Contributor

@Yopi if we want to reduce the errors and noise during DB migrations, I think the solution is to enforce an expand-contract pattern to be applied in every migration 🤔

If I'm not mistaken, this will make the errors and noise worse, as we are going to deploy changes sequentially, so the worker will try to use a removed column for longer.

@Yopi
Copy link
Contributor Author

Yopi commented Nov 4, 2025

Yes, that is the other half of the solution. The code using new columns needs to come after the migration, and vice-versa with removed columns.

If I'm not fully mistaken, the reason why we got issues yesterday is that we need to add new columns to the models for the DB migration to run, but the code with the models containing the new columns will be deployed before the migration has run. That causes the workers to fail to query data using the models.

Copy link
Contributor

@psincraian psincraian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, then combining the two makes total sense!

Approved for me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants