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

# 8.35. cleanupnodelock()

Function Properties

Language: PLPGSQL

Return Type: integer

Clean up stale entries when restarting slon

    declare
    	v_row		record;
    begin
    	for v_row in select nl_nodeid, nl_conncnt, nl_backendpid
    			from sl_nodelock
    			for update
    	loop
    		if killBackend(v_row.nl_backendpid, 'NULL') < 0 then
    			raise notice 'Slony-I: cleanup stale sl_nodelock entry for pid=%',
    					v_row.nl_backendpid;
    			delete from sl_nodelock where
    					nl_nodeid = v_row.nl_nodeid and
    					nl_conncnt = v_row.nl_conncnt;
    		end if;
    	end loop;

    	return 0;
    end;

Prev | Home | Next
cleanupevent(p_interval interval) | Up | clonenodefinish(p_no_provider integer, p_no_id integer)