Steve Singer ssinger at ca.afilias.info
Wed Jan 26 07:20:47 PST 2011
On 11-01-25 05:59 PM, Christopher Browne wrote:
> http://www.slony.info/bugzilla/show_bug.cgi?id=181
>
> I have set up a branch where I'm testing this, which has a regresison
> test.
>     https://github.com/cbbrowne/slony1-engine/tree/bulk-adding
>
> I'm getting a segfault problem, with the following slonik script:
>

Shame on me.

For some reason I though I tested this stuff after I put in the code to 
ignore nodes without slony installed.  Clearly I didn't.  Your segfault 
was caused by me failing to allocate/init one of the SlonDString 
variables before writing to it.  However there where some more 
fundamental problems with the logic.


I've pushed
https://github.com/ssinger/slony1-engine/commit/06970a7788a651f9ba68cb3dbaeac05c7e7c4e3b 
  to my bulk-adding branch.


I will try to find a place in the clustertest tests to add tests that 
cover all of:

* having a conninfo to a database where we can't connect to postgres
* having a conninfo to a database where we can connect but a database of 
that name does not exist.
* having a conninfo to a database that exists but does not have slony 
installed




> postgres at cbbrowne [05:53:26] [~/slony1-engine.github/tests] [bulk-adding *]
> ->  % cat /tmp/slony-regress.rZSbvU/slonik.script
> include</tmp/slony-regress.rZSbvU/slonik.preamble>;
> #init cluster (id=1, comment = 'Regress test node');
> echo 'update functions on node 1 after initializing it';
> update functions (id=1);
> #create set (id=1, origin=1, comment='All test1 tables');
> set add table (set id = 1, tables='public.*');
>
> Errors reported thus:
>
> ->  % slonik /tmp/slony-regress.rZSbvU/slonik.script
> /tmp/slony-regress.rZSbvU/slonik.script:3: update functions on node 1 after initializing it                                                                                         /tmp/slony-regress.rZSbvU/slonik.script:4: Possible unsupported PostgreSQL version (90100) 9.1, defaulting to 8.3 support
> /tmp/slony-regress.rZSbvU/slonik.script:4: WARNING:  This node is running PostgreSQL 8.3 - cannot apply TRUNCATE triggers
> CONTEXT:  SQL statement "SELECT "_slony_regress1".add_truncate_triggers()"
> PL/pgSQL function "upgradeschema" line 12 at PERFORM
> /tmp/slony-regress.rZSbvU/slonik.script:7: PGRES_FATAL_ERROR select max(tab_id) FROM "_slony_regress1".sl_table - ERROR:  schema "_slony_regress1" does not exist
> LINE 1: select max(tab_id) FROM "_slony_regress1".sl_table
>                                  ^
> [2]    29188 segmentation fault  slonik /tmp/slony-regress.rZSbvU/slonik.script
>
> It's blowing up in slonik_get_next_tab_id(), somewhere near the end of
> the function.
>
> Something's suspicious about the way queries are getting free'ed.



More information about the Slony1-hackers mailing list