pg-upgrade: Do not check data_dir free space for for --tmp-data_dir
What does this MR do?
Do not check for sufficient free space in
/var/opt/gitlab/postgresql/data
when using the --tmp-dir
option.
Related issues
Closes #5660 (closed)
Test plan
Preparation
It is recommended to to use a VM for testing as preparation is time-consuming and needs to be repeated for most tests. We will use a 14.9 installation upgraded to 15.11 while disabling automatic Postgres upgrades. Then copy the changes to the target VM. Note that the VM needs a separate partition/file-system from where /var/opt/gitlab/postgresql/data
is stored to use for the --tmp-dir
setting.
- Install 14.9.
- Disable automatic Postgresql upgrades:
sudo touch /etc/gitlab/disable-postgresql-upgrade
- Upgrade to 14.10.
- Upgrade to 15.0.
- Upgrade to 15.11.
- Copy
files/gitlab-ctl-commands/pg-upgrade.rb
to/opt/gitlab/embedded/service/omnibus-ctl/pg-upgrade.rb
. - Take snapshot.
Tests
Most test require a disk to be "full", defined as less space available than the size of database at /var/opt/gitlab/postgres/data
. Use the command:
sudo du -sh --block-size=1m /var/opt/gitlab/postgresql/data | cut -f1`
to get the size of the database in megabytes.
You can use the fallocate
command to fill the disk so there is less than database size space remaining.
-
Run sudo gitlab-ctl pg-upgrade
with non-full disk. -
Run sudo gitlab-ctl pg-upgrade
with "full" disk. Should report error. -
Run sudo gitlab-ctl pg-upgrade --tmp-dir <dir>
with "full" disk. -
Run sudo gitlab-ctl pg-upgrade --tmp-dir <dir>
with "non-full" disk. -
Run sudo gitlab-ctl pg-upgrade --tmp-dir <dir>
with "full" tmp disk. Should report error. -
Run sudo gitlab-ctl pg-upgrade --tmp-dir <dir>
on geo secondary node.
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion.
Required
-
MR title and description are up to date, accurate, and descriptive. -
MR targeting the appropriate branch. -
Latest Merge Result pipeline is green. -
When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow.
For GitLab team members
If you don't have access to this, the reviewer should trigger these jobs for you during the review process.
-
The manual Trigger:ee-package
jobs have a green pipeline running against latest commit. -
Ifconfig/software
orconfig/patches
directories are changed, make sure thebuild-package-on-all-os
job within theTrigger:ee-package
downstream pipeline succeeded. -
If you are changing anything SSL related, then theTrigger:package:fips
manual job within theTrigger:ee-package
downstream pipeline must succeed. -
If CI configuration is changed, the branch must be pushed todev.gitlab.org
to confirm regular branch builds aren't broken.
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes. -
Documentation created/updated. -
Tests added. -
Integration tests added to GitLab QA. -
Equivalent MR/issue for the GitLab Chart opened. -
Validate potential values for new configuration settings. Formats such as integer 10
, duration10s
, URIscheme://user:passwd@host:port
may require quotation or other special handling when rendered in a template and written to a configuration file.
Closes #5660 (closed)