Fix registry DB migration log accumulation

What does this MR do and why?

Backports !9433 (merged) ("Fix registry DB migration log accumulation") to 19-4-stable for the %19.4 patch release.

The registry database migration resource writes its output to a per-invocation timestamped file (db-migrations-YYYY-MM-DD-HH-MM-SS.log) and has no idempotency guard, so it runs unconditionally on every reconfigure. Logrotate is also not configured for the registry log directory. Long-lived instances accumulate one file per reconfigure indefinitely; any process tailing /var/log/gitlab/registry/*.log (notably gitlab-ctl tail, which uses tail --follow=name --retry) opens one file descriptor per file, eventually exhausting limits and surfacing as "Too many open files".

This backport appends migration output to a single rolling db-migrations.log with a timestamped run header per invocation, and adds the registry service to the default logrotate services list so the standard rotation policy (daily, 30 rotations, gzip, copytruncate) applies to the new file.

19-4-stable is affected: it carries the ~"missed:19.4" label on the original MR, and the prerequisite commit f0eab058 ("Fix registry migrations to support custom registry directory") is already present on this branch, so the fix applies as authored.

Backport details

  • Cherry-picked cleanly from 74f303c9 with git cherry-pick -x — no conflicts and no manual adjustments.
  • All four touched files are byte-identical to their master counterparts on this branch.
  • Original MR: !9433 (merged) (merged 2026-09-22, milestone %19.5)

Related to #9874 (closed) (closed by the original MR)

MR acceptance checklist

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

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The original MR has been deployed to GitLab.com (not applicable for documentation or spec changes).
    • !9433 (merged) is currently ~"workflow::staging"; this box should be checked once it reaches production.
  • This MR has a severity label assigned (if applicable).

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Merge request reports

Loading
Loading