Skip to content
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

Que upgrade does not set job job_schema_version to 2 #429

Open
hlascelles opened this issue Aug 19, 2024 · 5 comments
Open

Que upgrade does not set job job_schema_version to 2 #429

hlascelles opened this issue Aug 19, 2024 · 5 comments

Comments

@hlascelles
Copy link
Contributor

hlascelles commented Aug 19, 2024

We recently upgraded a project from to 2.x and found that all of the extant jobs were not being executed. It appears that the job_schema_version was still set to 1. This meant the new workers would ignore the enqueued jobs.

To get all the jobs running, we ran the following migration:

UPDATE que_jobs
SET job_schema_version = 2
WHERE job_schema_version IS DISTINCT FROM 2

I can imagine there is a rationale for this, such as to allow gradual no-downtime migration from one version to another. But it seems to have bitten a few people. Certainly us, a few here hlascelles/que-scheduler#412, and maybe this one #381.

Is there somewhere in the docs that we should put this as a debug step? And/or should it go in the migrate guide here: https://github.com/que-rb/que/blob/c0b0be8dc60ff18ea6a76a553ec38a273c303de3/docs/README.md#migrating

If nothing else, maybe this issue can live as a debug pointer.

@hlascelles
Copy link
Contributor Author

This is probably related: #365

@ZimbiX
Copy link
Member

ZimbiX commented Aug 19, 2024

This is by design. Did you miss the upgrade guide? https://github.com/que-rb/que/blob/master/CHANGELOG.md#200beta1-2022-03-24 I guess we assumed people would check the changelog when upgrading a major version

@ZimbiX
Copy link
Member

ZimbiX commented Aug 19, 2024

Maybe we could add a startup check that if any jobs exist with job_schema_version of 1 then a warning is logged with a link to the upgrade guide.

@hlascelles
Copy link
Contributor Author

Yes, looks like we (and a few others) missed it. Hmm, maybe it should be copied into the main docs.

I see the Migrating guide. Perhaps it can go in or near there?

And yes, a warning on startup sounds ideal!

@hlascelles
Copy link
Contributor Author

Alternatively we can close this and just leave it as a documentation pointer. Many people are probably now upgraded. Up to you. 👍

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

No branches or pull requests

2 participants