Steve Singer ssinger at ca.afilias.info
Thu Jan 13 08:46:36 PST 2011
Bug #102

http://www.slony.info/bugzilla/show_bug.cgi?id=102

If you have a configuration with 1 master and 2 or more slaves, and you have
all paths defined, slonik can hang during a failover.

In src/slonik/slonik.c, the slonik_failed_node function queries the sl_nodelock
table on each node to find the listener process responsible for that node and
stores it in nodeinfo.

Later in the function it loops through all the nodes, checking to see if the
listener responsible for that node has exited so it knows that slon has
restarted on that node.

Unfortunately, the query it uses just counts the number of processes that are
not that original pid. It obviously is expecting only one entry in the result
set (i.e., the replacement listener). If there are other listeners for other
nodes running on that node (as is the case when a second slave has a path
defined, for example), then that query may never return exactly 1.

The fix is to add the node number to the query, since then it finds the number
of processes that aren't the old listener that are assigned to that node. When
there is exactly 1 of those then the slon has restarted.

Per Michael Lee Squires @ whitepages.com
(cherry picked from commit d7d19c8b440420000c7ce4555726ad4b45fa812e)

Conflicts:

	src/slonik/slonik.c

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=slony1-engine.git;a=commitdiff;h=d1a65068722f62d14f4018e44367e2819c96cd7f

Modified Files
--------------
src/slonik/slonik.c |    8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)



More information about the Slony1-commit mailing list