2

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:

  1. Versioning the source code as normal and shutdown the environment to upgrade
  2. Versioning workers in their function registration names, ResizeFunction-v1.3
  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)

4

1 回答 1

0

不幸的是,在您的用例中,最好的选择是对函数名称进行版本控制,这样您就可以处理遗留函数的维护以及实现这些相同函数的新版本。您可以做的是在您的工作人员代码中实现一些日志记录并对其进行监控,一旦遗留工作人员在预定义的时间段内不再接收作业,您就知道您可以将该工作人员作为遗留代码退休。无需对 gearman 守护程序本身进行版本控制,因为您没有更改 gearman 守护程序本身的任何内容。

于 2016-02-04T02:43:17.073 回答