pt-slave-delay still computes wrong lag if slave is already lagging
From bug 962330 comment #3:
Looks like the issue still persists in some environments. We identified a corner case with the current patch for this bug. To reproduce the issue:
* Pick an arbitrary time to delay replication. For the purposes of this demonstration, a 1000 second delay line has been set.
* Start pt-slave-delay while the slave is behind. For the purposes of this demonstration, the server is 500 seconds behind when pt-slave-delay starts.
* Pt-slave-delay will catch the host up to the correct limit on the delay line, but will then fail to maintain the delay line at the correct value. The delay line will be increased by however many seconds the host was alreadyt behind its master in addition to the configured value. In this case, the total replication delay will be 1500.
A patch has been attached which corrects the behavior of the previously committed fix.