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

# 8.53. dropnode_int(p_no_id integer)

Function Properties

Language: PLPGSQL

Return Type: integer

internal function to process DROP_NODE event to drop node node_id from replication

    declare
    	v_tab_row		record;
    begin
    	-- ----
    	-- Grab the central configuration lock
    	-- ----
    	lock table sl_config_lock;

    	-- ----
    	-- If the dropped node is a remote node, clean the configuration
    	-- from all traces for it.
    	-- ----
    	if p_no_id <> getLocalNodeId('_schemadoc') then
    		delete from sl_subscribe
    				where sub_receiver = p_no_id;
    		delete from sl_listen
    				where li_origin = p_no_id
    					or li_provider = p_no_id
    					or li_receiver = p_no_id;
    		delete from sl_path
    				where pa_server = p_no_id
    					or pa_client = p_no_id;
    		delete from sl_confirm
    				where con_origin = p_no_id
    					or con_received = p_no_id;
    		delete from sl_event
    				where ev_origin = p_no_id;
    		delete from sl_node
    				where no_id = p_no_id;

    		return p_no_id;
    	end if;

    	-- ----
    	-- This is us ... deactivate the node for now, the daemon
    	-- will call uninstallNode() in a separate transaction.
    	-- ----
    	update sl_node
    			set no_active = false
    			where no_id = p_no_id;

    	-- Rewrite sl_listen table
    	perform RebuildListenEntries();

    	return p_no_id;
    end;

Prev | Home | Next
dropnode(p_no_ids integer[]) | Up | droppath(p_pa_client integer, p_pa_server integer)