Re: In-core regression tests for replication, cascading, archiving, PITR, etc. Michael Paquier - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: In-core regression tests for replication, cascading, archiving, PITR, etc. Michael Paquier
Date
Msg-id 52CBC4E6.40804@vmware.com
Whole thread Raw
In response to Re: In-core regression tests for replication, cascading, archiving, PITR, etc. Michael Paquier  (Mark Dilger <markdilger@yahoo.com>)
Responses Re: In-core regression tests for replication, cascading, archiving, PITR, etc. Michael Paquier  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 01/06/2014 07:12 PM, Mark Dilger wrote:
> The reason I was going to all the trouble of creating
> chrooted environments was to be able to replicate
> clusters that have tablespaces.

You can remove and recreate the symlink in pg_tblspc directory, after 
creating the cluster, to point it to a different location. It might be a 
bit tricky to do that if you have two clusters running at the same time, 
but it's probably easier than chrooting anyway. For example:

1. stop the standby
2. create the tablespace in master
3. stop master
4. mv the tablespace directory, and modify the symlink in master to 
point to the new location
5. start standby. It will replay the tablespace creation in the original 
location
6. restart master.

You now have the same tablespace in master and standby, but they point 
to different locations. This doesn't allow dynamically creating and 
dropping tablespaces during tests, but at least it gives you one 
tablespace to use.

Another idea would be to do something like chroot, but more lightweight, 
using FUSE, private mount namespaces, or cgroups.

- Heikki



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: ERROR: missing chunk number 0 for toast value
Next
From: Dan Ports
Date:
Subject: Re: Re: How to reproduce serialization failure for a read only transaction.