Trace job artifacts have locked: unknown and will never be updated by UpdateUnknownLockedStatusService
As of 2023-01-22, we had a large number of trace job artifacts that still have locked: unknown
.
These trace job artifacts will never have their locked
status changed from unknown
to locked/unlocked
, because we have completely removed the incorrect expire_at
from these records.
The query to unlock job artifacts with unknown
filters for job artifacts that had expired before the current time. This skips all the existing trace job artifacts because their expire_at
is nil
.
def expired_locked_unknown_artifacts
# UPDATE queries perform better without the specific order and limit
# https://gitlab.com/gitlab-org/gitlab/-/merge_requests/76509#note_891260455
Ci::JobArtifact.expired_before(@start_at).artifact_unknown
end