Geo: replicate-geo-database does not honor postgresql['data_dir']
Summary
Running replicate-geo-database
does not honor postgresql['data_dir']
. It moves the old data directory to /var/opt/gitlab/postgresql/data.xxxxxxxx
and creates a new /var/opt/gitlab/postgresql/data
leaving the symlink pointing to the old data dir.
Steps to reproduce
- Set up secondary Geo node
- Set
postgresql['data_dir']
ingitlab.rb
. - Run
replicate-geo-database
.
What is the current bug behavior?
The old data directory is moved to /var/opt/gitlab/postgresql/data.xxxxxxxx
and the symlink is not updated to point to the new data directory as specified in postgresql['data_dir']
.
What is the expected correct behavior?
Old data directory should be moved and the symlink should be updated to point to the directory specifed in postgresql['data_dir']
.
Relevant logs and/or screenshots
* Checking for replication slot secondary_example
* Backing up postgresql.conf
* Moving old data directory to '/var/opt/gitlab/postgresql/data.1526335006'
* Starting base backup as the replicator user (gitlab_replicator)
pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
transaction log start point: D8/D7000028 on timeline 1
pg_basebackup: starting background WAL receiver
46360/46360 kB (100%), 1/1 tablespace
transaction log end point: D8/D70000F8
pg_basebackup: waiting for background process to finish streaming ...
pg_basebackup: base backup completed
* Writing recovery.conf file with sslmode=disable
* Restoring postgresql.conf
* Setting ownership permissions in PostgreSQL data directory
* Starting PostgreSQL and all GitLab services
[postgresql]$ ll
<snip>
drwx------ 19 gitlab-psql gitlab-psql 4096 May 14 12:16 data/
drwx------ 19 gitlab-psql root 4096 Apr 23 10:34 data.1524504890/
drwx------ 19 gitlab-psql gitlab-psql 4096 May 3 15:19 data.1525385991/
lrwxrwxrwx 1 root root 37 May 14 07:08 data.1526325398 -> /var/opt/gitlab/postgresql/data_moved/
drwx------ 19 gitlab-psql gitlab-psql 4096 May 14 12:16 data_moved/
Customer ticket -> https://gitlab.zendesk.com/agent/tickets/96205 (internal)
Version
10.5.6-ee
Edited by Jason Plum