Jan Wieck JanWieck at Yahoo.com
Fri Jul 20 07:25:43 PDT 2007
On 7/20/2007 6:06 AM, Mikko Partio wrote:
> 
> 
> On 7/19/07, *Jan Wieck* <JanWieck at yahoo.com <mailto:JanWieck at yahoo.com>> 
> wrote:
> 
>     On 7/19/2007 12:58 AM, Mikko Partio wrote:
> 
>     No, only the slon of a real replica can actually write the log files.
>     However, what might work in your case is to create a "fake" replica.
>     Create a replica that has a slave-only trigger (using STORE TRIGGER) on
>     every replicated table. The trigger fires BEFORE INSERT and all it does
>     is RETURN NULL. And you subscribe the thing with no forwarding. That
>     should create an empty replica that now can write the log shipping
>     files. To get the initial content for the offline replica you must
>     however stop the application and dump from the origin.
> 
> 
> 
> One question, the script slony1_dump.sh retrieves the sync-value for 
> table sl_setsync_offline from the sl_setsync -table. I modified the 
> script so that the data gets dumped from the origin node (since the 
> subscriber is empty), but the sl_setsync table is empty at the origin, 
> Where can I get the correct sync number (is select max(con_seqno) from 
> sl_confirm ok) ?

That is precisely the problem why you have to stop the application at 
least briefly.

   - Stop application
   - Let (dummy) subscriber completely catch up
   - Get number from subscribers sl_setsync
   - Start the dump on the origin

Due to MVCC, the dump will have the data that would have been on the 
subscriber at that setsync. You don't have to wait for the dump to 
finish. Once it has started its serializable transaction (which it does 
right away), the application can be restarted.

All of that can be done in a minute, so any scheduled maintenance time 
will give you an opportunity to do it in production.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck at Yahoo.com #


More information about the Slony1-general mailing list