Bug 245 - slony tutorial + new feature (set add table with a regexp) does not work
Summary: slony tutorial + new feature (set add table with a regexp) does not work
Status: NEW
Alias: None
Product: Slony-I
Classification: Unclassified
Component: slonik (show other bugs)
Version: devel
Hardware: PC Linux
: low major
Assignee: Slony Bugs List
URL:
Depends on:
Blocks:
 
Reported: 2011-10-18 02:25 UTC by Cédric Villemain
Modified: 2011-10-19 05:01 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cédric Villemain 2011-10-18 02:25:20 UTC
based on the tutorial.

/usr/lib/postgresql/9.1/bin/slonik < create_set.slonik
<stdin>:8: waiting for event (1,5000000011) to be confirmed on node 2

same output for (very) long time, I have to kill slonik

preamble.slonik
	cluster name = slony;
	node 1 admin conninfo = 'dbname=slony_bench host=192.168.100.165 user=replicator';
	node 2 admin conninfo = 'dbname=slony_bench host=192.168.100.237 user=replicator';
	node 3 admin conninfo = 'dbname=slony_bench host=192.168.122.111 user=replicator';
	node 4 admin conninfo = 'dbname=slony_bench host=192.168.122.22 user=replicator';

create_set.slonik
include </tmp/preamble.slonik>;
init cluster (id = 1);
create set (id = 1, origin = 1);
set add table (set id=1, tables='public\\.*');

store node (id=2, event node=1);
store node (id=3, event node=1);
store node (id=4, event node=2);

store path (server = 1, client = 2, conninfo='dbname=slony_bench host=192.168.100.165 user=replicator');
store path (server = 1, client = 3, conninfo='dbname=slony_bench host=192.168.100.165 user=replicator');
store path (server = 1, client = 4, conninfo='dbname=slony_bench host=192.168.100.165 user=replicator');

store path (server = 2, client = 1, conninfo='dbname=slony_bench host=192.168.100.237 user=replicator');
store path (server = 2, client = 3, conninfo='dbname=slony_bench host=192.168.100.237 user=replicator');
store path (server = 2, client = 4, conninfo='dbname=slony_bench host=192.168.100.237 user=replicator');

store path (server = 3, client = 1, conninfo='dbname=slony_bench host=192.168.122.111 user=replicator');
store path (server = 3, client = 2, conninfo='dbname=slony_bench host=192.168.122.111 user=replicator');
store path (server = 3, client = 4, conninfo='dbname=slony_bench host=192.168.122.111 user=replicator');

store path (server = 4, client = 1, conninfo='dbname=slony_bench host=192.168.122.22 user=replicator');
store path (server = 4, client = 2, conninfo='dbname=slony_bench host=192.168.122.22 user=replicator');
store path (server = 4, client = 3, conninfo='dbname=slony_bench host=192.168.122.22 user=replicator');
Comment 1 Cédric Villemain 2011-10-18 02:41:02 UTC
it happens that the problem come from the node 2 cascading to node 4.
Comment 2 Cédric Villemain 2011-10-18 02:44:45 UTC
I change the order of store node and it fix the situation. It is maybe expected but slonik should prevent the deadlock here.

store node (id=2, event node=1);
store node (id=3, event node=1);
store path (server = 1, client = 2, conninfo='dbname=slony_bench host=192.168.100.165 user=replicator');
store path (server = 1, client = 3, conninfo='dbname=slony_bench host=192.168.100.165 user=replicator');
store path (server = 2, client = 1, conninfo='dbname=slony_bench host=192.168.100.237 user=replicator');
store path (server = 2, client = 3, conninfo='dbname=slony_bench host=192.168.100.237 user=replicator');
store path (server = 3, client = 1, conninfo='dbname=slony_bench host=192.168.122.111 user=replicator');
store path (server = 3, client = 2, conninfo='dbname=slony_bench host=192.168.122.111 user=replicator');

store node (id=4, event node=2);
store path (server = 1, client = 4, conninfo='dbname=slony_bench host=192.168.100.165 user=replicator');
store path (server = 2, client = 4, conninfo='dbname=slony_bench host=192.168.100.237 user=replicator');
store path (server = 3, client = 4, conninfo='dbname=slony_bench host=192.168.122.111 user=replicator');
store path (server = 4, client = 1, conninfo='dbname=slony_bench host=192.168.122.22 user=replicator');
store path (server = 4, client = 2, conninfo='dbname=slony_bench host=192.168.122.22 user=replicator');
store path (server = 4, client = 3, conninfo='dbname=slony_bench host=192.168.122.22 user=replicator');
Comment 3 Steve Singer 2011-10-19 03:13:42 UTC
This is an issue with the tutorial.

store node(id=2,event node=1)
store node(id=3,event node=1)
store node(id=4,event node=2);

should not work,  with until the third line has been propogated to node 2.

Consider these example as why

store node(id=2,event node=1)
store node(id=3,event node=1)
store node(id=3,event node=2);

The tutorial should be updated to either use event node=1
or it could be updated to put the store paths in between
Comment 4 Cédric Villemain 2011-10-19 03:52:47 UTC
(In reply to comment #3)
> This is an issue with the tutorial.
> 
> store node(id=2,event node=1)
> store node(id=3,event node=1)
> store node(id=4,event node=2);
> 
> should not work,  with until the third line has been propogated to node 2.
> 
> Consider these example as why
> 
> store node(id=2,event node=1)
> store node(id=3,event node=1)
> store node(id=3,event node=2);
> 
> The tutorial should be updated to either use event node=1
> or it could be updated to put the store paths in between

I abused of the tutorial reference here, the tutorial is only for 2 nodes.
While I understand why it does not work,maybe slonik can check that there is no 'deadlock' in the slonik script.
Comment 5 Steve Singer 2011-10-19 05:01:47 UTC
Checking for deadlock due to missing paths sounds like a good idea. It was discussed when the auto-wait for stuff was proposed but we didn't want to bite off too much at once.

Patches always welcome :)