Add maintenance runner for cleaning-up (retrieve) queue requests and managing new internal states
This ticket is a follow-up to https://gitlab.cern.ch/cta/CTA/-/issues/1175, completing the changes required for the new state REPACKING.
These changes have been agreed in the dev meeting of 6 May 2022] (see minutes here).
-
New internal states REPACKING_PENDING & BROKEN_PENDING. These temporary states are automatically triggered when a transition to REPACKING/BROKEN is requested with
cta-admin
. They represent a temporary state where the pre-existing requests are in the process of being deleted or moved, before the tape is moved to a final state (REPACKING or BROKEN). - Queue cleanup runner. New runner, in the maintenance process, responsible for cleaning up requests in internal states (REPACKING_PENDING & BROKEN_PENDING). These requests should be moved into a different queue (if a copy exists on a ACTIVE/DISABLED tape) or reported back to the user as an error. After completing the cleanup, the runner should move the tape into the final state (REPACKING/BROKEN).
-
cleanMe flag in queue object. The
cta-admin
will activate a boolean flag in the queue object when a queue needs to be cleaned-up. This flag will be periodically checked by the maintenance process (no lock) in order to know when a cleanup request was done. If the queue object does no exist,cta-admin
should trigger its creation to avoid race conditions.