Introduce 'gdk truncate-legacy-tables' command
What does this merge request do and why?
This MR removes the make truncate-legacy-tables
from the gdk reconfigure
command as it's not necessary for fresh installations of GDK. Instead, it introduces a new gdk truncate-legacy-tables
command to handle truncating unnecessary data in the main
and ci
databases.
The MR also adds a diagnostic to check for stale data and suggest users to run gdk truncate-legacy-tabls
when it's needed.
Closes #2013 (closed)
How to set up and validate locally
git checkout 2013-no-db-truncate-on-gdk-bootstrap
gdk config set gitlab.rails.databases.ci.enabled true && gdk config set geo.secondary false
rm .cache/.truncate_tables
-
gdk doctor
Stale Data ================================================================================ You might encounter a PG::CheckViolation error during database migrations, likely due to stale data in the ci database that belongs in the main database, or vice versa. To address this, you can run: gdk truncate-legacy-tables
-
gdk truncate-legacy-tables
$ gdk truncate-legacy-tables => Ensuring legacy data in main & ci databases are truncated. ... ✅️ Legacy table truncation completed successfully.
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by Nao Hashizume