Skip to content

Stop running Unicorn/Sidekiq on the blessed worker for deployments with fewer errors

Currently we use the blessed worker for running database migrations. Because this host also runs Unicorn/Sidekiq the following can happen:

  1. We deploy new code
  2. A process restarts, and ends up loading the new code
  3. We run DB migrations

At this point there may be processes on this host using new code that depends on schema/data changes that are not yet present, producing errors as a result.

An easy solution to this problem would be the following:

  1. We add one worker server
  2. We disable Sidekiq/Unicorn/SSH on the blessed worker
  3. We run migrations and such on the blessed worker, as usual

This ensures that until we run chef-client on all hosts no host is using new source code before database migrations are complete. This in turn should cut down the number of errors happening during a deploy.