terminatenodeconnections(p_failed_node integer)

Slony-I 2.2.10 Documentation
Prev | Fast Backward | Chapter 8. Schema schemadoc | Fast Forward | Next

# 8.130. terminatenodeconnections(p_failed_node integer)

Function Properties

Language: PLPGSQL

Return Type: integer

terminates all backends that have registered to be from the given node

    declare
    	v_row			record;
    begin
    	for v_row in select nl_nodeid, nl_conncnt,
    			nl_backendpid from sl_nodelock
    			where nl_nodeid = p_failed_node for update
    	loop
    		perform killBackend(v_row.nl_backendpid, 'TERM');
    		delete from sl_nodelock
    			where nl_nodeid = v_row.nl_nodeid
    			and nl_conncnt = v_row.nl_conncnt;
    	end loop;

    	return 0;
    end;

Prev | Home | Next
tablestovacuum() | Up | uninstallnode()