From 1e5b1c8f52524bb58d9f53f56d80cd299628307a Mon Sep 17 00:00:00 2001 From: Siddharth Kannan Date: Wed, 26 Nov 2025 16:16:45 +0530 Subject: [PATCH] feat: Enable automatic DB reindexing in CNG installations Related to https://gitlab.com/gitlab-com/gl-infra/delivery/-/work_items/21668 [Automatic database reindexing] is possible in Omnibus installation by flipping some configuration values inside the `gitlab.rb` file. As far as I can tell, Helm chart installations that use CNG (Cloud Native GitLab) container images do not have a native method for runnig reindexing periodically. The Toolbox chart already has a CronJob for taking a backup. So, I am proposing that we add a CronJob that will perform automatic database reindexing on a user-specified schedule. [Automatic database reindexing]: https://docs.gitlab.com/omnibus/settings/database/#automatic-database-reindexing --- gitlab-rails/scripts/db-reindex | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 gitlab-rails/scripts/db-reindex diff --git a/gitlab-rails/scripts/db-reindex b/gitlab-rails/scripts/db-reindex new file mode 100755 index 000000000..9560dac4e --- /dev/null +++ b/gitlab-rails/scripts/db-reindex @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +echo "Performing automatic database reindexing" +cd /srv/gitlab +/srv/gitlab/bin/rake gitlab:db:reindex -- GitLab