I'm converting a linear processing system to Gearman but I haven't actually deployed Gearman on a production environment.
We have a deployment chain in regards to pushing new versions of source code (Staging, Dark launches, A/B) but since Gearman workers are completely separate from the main application, how do we upgrade them ?
There are a couple of options that come to mind, none of them are perfect:
- Versioning the source code as normal and shutdown the environment to upgrade
- Versioning workers in their function registration names,
ResizeFunction-v1.3
- Add version number into workers and attach them to jobs so that if a worker should not process it, it can quit and let another one handle it.
The Ideal scenario would allow me to handle updates of worker code without worrying that jobs from old client code will get picked up by incompatible workers, so smooth version upgrades.
I guess semantic versioning will apply here (v1.0.0
- Major.minor.patch, Major would break API compatibility, minor adds new features, and patch fixes bugs)