Christopher Browne cbbrowne
Tue Aug 23 22:51:45 PDT 2005
Darcy Buskermolen wrote:

>On Thursday 28 July 2005 11:49, Christopher Browne wrote:
>  
>
>>I discovered yesterday that a couple of changes were needed to this
>>patch to accomodate log shipping...
>>
>>1.  Change to remote_worker.c
>>
>>(I don't have a reasonable "diff of a diff"; this should be clear
>>enough, particularly as it's only a few lines of change)
>>
>>@@ -2778,7 +2810,10 @@
>>         if (archive_dir) {
>>             slon_log(SLON_DEBUG4, "start log ship copy of %s\n",
>>tab_fqname);
>>             slon_mkquery(&query1,
>>-                     "delete from %s;copy %s from stdin;", tab_fqname,
>>tab_fqname);
>>+                     "select %s.disableSubscriptionIndexes('%s'); "
>>+                     "delete from %s; "
>>+                     "copy %s from stdin;",
>>+                     rtcfg_namespace, tab_fqname, tab_fqname, tab_fqname);
>>             rc = submit_query_to_archive(&query1);
>>             if (rc < 0) {
>>                 slon_log(SLON_ERROR, "remoteWorkerThread_d: "
>>
>>2.  Need enable/disableSubscriptionIndexes() in the initial dump...
>>    
>>
>
>There is a problem with the slony1-dump patch as youhave provided, it has no 
>logic to load the correct functions depending on PostgreSQL version.  I think 
>we may have to rethink how slony1_diump.sh works both to be able to deal with 
>the above version logic, as well as prevent code duplication.
>
>One thing we could do in the interim is to only disable indexes during 
>conventional slony operation, and ignore that during logshipping mode.
>  
>
Essentially, that turns disable/enableSubscriptionIndices() into NOP (no
operation) routines, which, while "performance pessimal," isn't the
worst thing we could possibly do.

If we can put in a decent default in slony1-dump, and perhaps warn
people that if they are running a too-{old|new} version of PostgreSQL,
they may have to replace those functions, that's also not the worst
possible thing to do.

I'd be keener on having a PG-version-specific set of enable/disable
functions; that's an even better improvement to the patch :-).


More information about the Slony1-general mailing list