Skip to content

Add better ttl value for loose FK cleanup worker

Adam Hegyi requested to merge loose-fk-adjust-ttl into master

What does this MR do and why?

This MR improves the ttl value for the loose FK cleanup worker.

Consider the following case:

  1. The cleanup worker is scheduled every 5 minutes to process records.
    • The maximum allowed runtime is 3 minutes. This is enforced by the ModificationTracker class.
  2. After maximum of 3 minutes (and a few seconds because it's not 100% accurate) the job finishes, and leaves less than 2 minutes to cool off until the next job is scheduled.
  3. Go to step 1.

In case the worker raises an error or the sidekiq process is restarted/killed, Redis will keep a lock for 1 hour which means we might not process anything during this time.

We change the ttl from 1 hour to 3 + 1 minutes to avoid the 1 hour gap.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Adam Hegyi

Merge request reports