lshift/diffa — pull request #242 by paulj (2012-08-02 04:55:25+00:00)
Title: Support phased escalations

This patch adds support for persistent, phased escalations. This is achieved by allowing a `delay` value to be set on an escalation when it is configured. When an escalatable difference appears, the escalation will not longer be executed immediately - it will be scheduled to execute at `detectionTime + delay`. This enables a series of escalations (of potentially increasing desperation) to be configured for a pair, and executed based upon the age of the difference. A secondary effect of this patch is that escalations will no longer run at the completion of every scan for every known difference; instead, only new differences will trigger escalation.

This patch includes the necessary DB changes, kernel and UI changes. The only known issue is that attempting to remove an escalation that differences are currently scheduled to use will be prevented by a foreign key constraint. Ideally, we should progress all differences to the next available escalation - but working out the right eventing technique to make the various system components participate is the difficulty. Note that this should not prevent a pair being deleted, as the differences will be removed during the pair removal anyway.