Thu Jul 31 23:49:21 PDT 2008
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 1 Aug 2008, Yi Zhao wrote: > ok, what should do to merge it? my script is below: > > try { > create set (id = 2, origin = 1, comment = 'Set 2 for replication'); > } on error { > echo 'Could not create subscription set 2 for replication'; > exit -1; > } > set add table (set id = 2, origin = 1, id = 523, full qualified name = > 'content.thread_preference', comment = 'nodesc'); > > try { > subscribe set (id = 2, provider = 1, receiver = 2, forward = yes); > subscribe set (id = 2, provider = 1, receiver = 3, forward = yes); > } on error { > echo 'Could not create subscribe for replication'; > exit -1; > } > > merge set (id = 1, add id = 2, origin = 1); > > try { > drop set (id = 2, origin = 1); > } on error { > exit 1; > } > echo 'Set 2 droped'; > > thanks again for your fast reply. You don't need to drop it after you've merged it. The 2nd set will go away after the merge is complete. If you want to do it all in a script, you may need to add some slonik logic like this to wait for the subscription to complete before trying to merge: SUBSCRIBE SET (id=2, provider=1, receiver=2, forward=yes); WAIT FOR EVENT (origin=2, confirmed=1, wait on=2); SYNC(id = 1); WAIT FOR EVENT (origin=1, confirmed=2, wait on=1); SUBSCRIBE SET (id=2, provider=2, receiver=3, forward=no); WAIT FOR EVENT (origin=3, confirmed=2, wait on=3); SYNC(id = 2); WAIT FOR EVENT (origin=2, confirmed=3, wait on=2); MERGE SET ( id = 1, add id = 2, origin = 1 ); I think you can wrap them with trys and echos yourself. > > regards. > > On Thu, 2008-07-31 at 23:33 -0700, Jeff Frost wrote: >> On Fri, 1 Aug 2008, Yi Zhao wrote: >> >>> yes, as you said, It's my fault that I haven't add any node to set. >>> >>> now, I have do that, but, when merge, I got: >>> <stdin>:13: Subscription set 2 created >>> <stdin>:15: Adding tables to subscription set >>> <stdin>:26: Subscribe created >>> <stdin>:28: PGRES_FATAL_ERROR select "_replication".mergeSet(1, 2); - >>> ERROR: Slony-I: set 2 has subscriptions in progress - cannot merge >>> >>> >>> should I stop all the slon process??? >> >> No, there is no need to stop the slons. >> > > -- Jeff Frost, Owner <jeff at frostconsultingllc.com> Frost Consulting, LLC http://www.frostconsultingllc.com/ Phone: 650-780-7908 FAX: 650-649-1954
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Slony1-general mailing list