-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
barman-cloud-restore and missing links for tablespaces #343
Comments
amenonsen
added a commit
that referenced
this issue
Jul 22, 2021
Each tablespace has a name, an oid, and a location (directory), and there is a symbolic link from $PGDATA/pg_tblspc/$oid to the location. barman-cloud-backup uploads a $oid.tar file for each tablespace, and records the properties of each tablespace in backup_info.tablespaces. Until now, barman-cloud-restore knew only how to download $oid.tar and extract its contents to the original location. Here we add a couple of new features: 1. You may optionally specify `--tablespace name:/new/location` to extract a given tablespace to a different location (you can repeat this option multiple times) 2. After downloading and extracting $oid.tar to the desired location, we now recreate the symbolic link from $PGDATA/pg_tblspc/$oid to that directory. Closes #343 Closes #330
@pguser4ever #355 should address both (1) and (4) above. Comments welcome. (2) still under investigation. |
amenonsen
added a commit
that referenced
this issue
Jul 23, 2021
Each tablespace has a name, an oid, and a location (directory), and there is a symbolic link from $PGDATA/pg_tblspc/$oid to the location. barman-cloud-backup uploads a $oid.tar file for each tablespace, and records the properties of each tablespace in backup_info.tablespaces. Until now, barman-cloud-restore knew only how to download $oid.tar and extract its contents to the original location. Here we add a couple of new features: 1. You may optionally specify `--tablespace name:/new/location` to extract a given tablespace to a different location (you can repeat this option multiple times) 2. After downloading and extracting $oid.tar to the desired location, we now recreate the symbolic link from $PGDATA/pg_tblspc/$oid to that directory. Closes #343 Closes #330
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello
We like Barman and use multiple Barman servers in our production envionment, but to start using the barman-cloud stuff there are several things that causes problems for us. Most of the problems have been reported earlier but not sure about missing links for tablespaces after barman-cloud-wal-restore
1/
barman-cloud-backup seems to be working but we need support for pg_wal and symbolic link
agree with case #327 it is very common to use like we do
(barman-cloud-backup -e AES256 -j -v -J 4 s3://barman-s3-backup/ whdb)
2/
barman-cloud-restore seems to working as well and used recover param.
restore_command = 'barman-cloud-wal-restore s3://barman-s3-backup whdb %f %p'
recovery_target_timeline = 'latest'
But also got ERROR: Barman cloud WAL restore exception: coercing to Unicode: need string or buffer, StreamingBody found
same as #325 ?
(barman-cloud-restore -e AES256 -v s3://barman-s3-backup whdb 20210702T121955 /pg/pgcluster/whdb/data)
3/
Copy all the wal files to local disk
(aws s3 cp s3://barman-s3-backup/whdb/wals/0000018F00000006/ restore_dir --recursive)
changed restore_command
restore_command = 'cp /pg/pglog/whdb/restore_dir/%f "%p"'
4/
started recovery and it worked, instance started up
but connect failed what ??
psql: error: could not connect to server: FATAL: database "whdb" does not exist
DETAIL: The database subdirectory "pg_tblspc/16386/PG_12_201909212/16388" is missing
Same case as #330 ? maybe
But creating links to tablepaces solved the problem
ln -s /pg/pgdata/whdb/data/tswhdb01 /pg/pgcluster/whdb/data/pg_tblspc/16385
ln -s /pg/pgdata/whdb/data/tsuserspace1 /pg/pgcluster/whdb/data/pg_tblspc/16386
ln -s /pg/pgtemp/whdb/data /pg/pgcluster/whdb/data/16387
psql (12.4)
Type "help" for help.
whdb=#
The text was updated successfully, but these errors were encountered: