vmware/pg_rewind — pull request #22 by Samrat-Revagade (2014-01-22 07:21:24+00:00)
Title: Table space support

This patch aims to solve the following two issues in pg_rewind:
1. Table-space support
2. Symbolic link problems

1. Table-space support:

This is version -1 for table-space support in which we able to rewind where,
old master makes some changes under non default table-space which new master never saw.

But when old master drops table-space then we show meaningful error message and exit.

Also when if we are running in source directory mode and using non default table-space, then it will exit with error message to avoid possibility of data corruption.

2. Symbolic- link problems:

For example: pg_rewind fails with following error if we initialize cluster with -X option

$ ./pg_rewind -D /home/samrat/pg_rewind/data-patched-sync --source-server="host=172.26.126.38 port=5432 dbname=postgres" -v
connected to remote server
fetched file "global/pg_control", length 8192
fetched file "pg_xlog/00000002.history", length 41
The servers diverged at WAL position 0/3014700 on timeline 1.
Rewinding from Last common checkpoint at 0/3000028 on timeline 1
"/home/samrat/pg_rewind/data-patched-sync/pg_xlog" is not a directory.

It will also fail in some real time systems, where to improve performance we put clog on other locations (fast access storage device) to by setting up symbolic link to pg_clog directory.

In short if we make symbolic link to any where in database cluster pg_rewind fails.

I think this patch is useful for both issues (table-space and symbolic link).
Please have a look at it and give your feedback.