Jan Wieck JanWieck at Yahoo.com
Fri Jun 1 14:54:24 PDT 2007
On 6/1/2007 1:21 PM, Andrew Hammond wrote:
> On 6/1/07, Jan Wieck <JanWieck at yahoo.com> wrote:
>> On 6/1/2007 10:52 AM, Dmitry Koterov wrote:
>> > I also tried to use
>> >
>> > try {
>> >    ...
>> > } on success {
>> >   WAIT FOR EVENT (
>> >       ORIGIN = ALL,
>> >       CONFIRMED = ALL,
>> >       WAIT ON = 1
>> >   )
>> > }
>>
>> Looking at the code, it seems that EXECUTE SCRIPT doesn't actually
>> record the events seqno in the admin conninfo. Which means that WAIT FOR
>> EVENT will wait for an earlier event, or even nothing. Unfortunately the
>> same is true for SYNC in 1.2.9.
> 
> Hmmm, I'm looking at slonik.c under slonik_ddl_script() and I see
> (starting at line 3706)
> 
>     slon_mkquery(&query,
>              "select \"_%s\".ddlScript_prepare(%d, %d); ",
>              stmt->hdr.script->clustername,
>              stmt->ddl_setid, /* dstring_data(&script),  */
>              stmt->only_on_node);
> 
>     if (db_exec_evcommand((SlonikStmt *) stmt, adminfo1, &query) < 0)
> 
> So, it looks like it's recording the event's seqno in the admin
> conninfo. What am I missing?

You're missing that it isn't ddlScript_prepare() that generates the 
event we want to wait for, but ddlScript_complete(). And that one isn't 
called via db_exec_evcommand().


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