cleanupnodelock()

Slony-I 2.0.4 Documentation
Prev | Fast Backward | Chapter 1. Schema schemadoc | Fast Forward | Next

# 1.28. 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(interval, boolean) | Up | clonenodefinish(integer, integer)