worker icon indicating copy to clipboard operation
worker copied to clipboard

Do compatibility check on startup

Open benjie opened this issue 3 years ago • 1 comments

If you're running Graphile Worker in multiple separate systems but all connecting to the same database, there's a risk that your workers may come out of sync. Normally it's a best practice for only one of these systems to run the migrations (unless you can enforce that every Graphile Worker instance is the same version of Graphile Worker) - so we should do a check on startup that

  • if you're not running the migrations then the DB has to be up to date
  • if you are running the migrations then ensure no newer (unknown) migrations exist in the DB

If either of these fail then we need to make a decision on whether to continue or not.

benjie avatar Jul 29 '22 12:07 benjie

(Would be good if we can run a v1.1 worker against a v1.3 database schema without issues. Breaking database changes should require a semver major bump.)

benjie avatar Jul 29 '22 12:07 benjie

Not sure if related https://github.com/graphile/worker/issues/299

tonyxiao avatar Oct 26 '22 10:10 tonyxiao

if worker does not run migration on startup it would be good for worker to check for compatibility on startup. I'd be even happy with strict compatibility checks version ===

tonyxiao avatar Oct 26 '22 10:10 tonyxiao