Include detached partition tables in truncate_legacy_tables
What does this MR do and why?
Fixes the issue where we attempt to truncate tables that are referenced from such detached partition tables
Related issue: #382130 (closed)
It should be safe to truncate such tables because there should be a copy of the data for the detached partition tables in the other database.
Other options considered:
- Drop all partitions immediately after detach - this is a featureenhancement which we can do later
- Drop the detached partition on ci only. This is mixing responsibilities - it may have unexpected surprises if we drop tables on a truncate rake task.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
How to set up and validate locally
Run:
bin/rake gitlab:db:lock_writes
bin/rake gitlab:db:truncate_legacy_tables:main
bin/rake gitlab:db:truncate_legacy_tables:ci
bin/rake gitlab:db:unlock_writes
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Thong Kuah