Jan Wieck jan at wi3ck.info
Sun Jul 26 17:01:40 PDT 2015
On 07/26/2015 07:35 PM, Jan Wieck wrote:
> That said, pg_dump isn't that much faster than Slony's copy_set() so
> we'd need to find a way to reconstruct an sl_setsync entry from
> something like a binary base backup. That is not trivial.

Here is a wild idea that I am going to test, but someone may throw a 
wrench into it while I'm doing that:

Let us assume that the application can be stopped and the database 
brought into so called "single user mode" for a short period of time. 
During that maintenance window we do the following:

   * Shutdown the application
   * Create the cluster with two nodes and paths via slonik script.
   * Shutdown the slon for the slave.
   * Create a SYNC event on the master.
   * Execute a SUBSCRIBE SET ... OMIT COPY.
   * Create an LVM snapshot of $PGDATA (+ pg_xlog ...)
   * Resume the application

That should take no longer than a few minutes. Properly scripted it 
could be in the second range. We now could

   * Use LVM snapshot(s) to plow over the slave's $PGDATA and so on.
   * Modify the slave's DB to correct the local node ID and fake an
     sl_setsync entry reflecting the SYNC created on the master.
   * Fire up the slave's slon.


Comments?


-- 
Jan Wieck
Senior Software Engineer
http://slony.info


More information about the Slony1-general mailing list