mirror of https://github.com/citusdata/citus.git
Updates udf name
parent
63311e546f
commit
1c05eebebe
|
@ -152,7 +152,7 @@ PG_FUNCTION_INFO_V1(master_disable_node);
|
|||
PG_FUNCTION_INFO_V1(citus_activate_node);
|
||||
PG_FUNCTION_INFO_V1(master_activate_node);
|
||||
PG_FUNCTION_INFO_V1(citus_update_node);
|
||||
PG_FUNCTION_INFO_V1(citus_pause_node);
|
||||
PG_FUNCTION_INFO_V1(citus_pause_node_within_txn);
|
||||
PG_FUNCTION_INFO_V1(master_update_node);
|
||||
PG_FUNCTION_INFO_V1(get_shard_id_for_distribution_column);
|
||||
PG_FUNCTION_INFO_V1(citus_nodename_for_nodeid);
|
||||
|
@ -1332,7 +1332,7 @@ citus_update_node(PG_FUNCTION_ARGS)
|
|||
|
||||
|
||||
Datum
|
||||
citus_pause_node(PG_FUNCTION_ARGS)
|
||||
citus_pause_node_within_txn(PG_FUNCTION_ARGS)
|
||||
{
|
||||
CheckCitusVersion(ERROR);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
-- citus--12.0-1--12.1-1
|
||||
|
||||
#include "udfs/citus_pause_node/12.1-1.sql"
|
||||
#include "udfs/citus_pause_node_within_txn/12.1-1.sql"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
-- citus--12.1-1--12.0-1
|
||||
-- this is an empty downgrade path since citus--12.0-1--12.1-1.sql is empty for now
|
||||
|
||||
DROP FUNCTION pg_catalog.citus_pause_node(int);
|
||||
DROP FUNCTION pg_catalog.citus_pause_node_within_txn(int);
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
CREATE FUNCTION pg_catalog.citus_pause_node(node_id int)
|
||||
RETURNS void
|
||||
LANGUAGE C STRICT
|
||||
AS 'MODULE_PATHNAME', $$citus_pause_node$$;
|
||||
|
||||
COMMENT ON FUNCTION pg_catalog.citus_pause_node(node_id int)
|
||||
IS 'pauses node with given id which leads to add lock in tables and prevent any queries to be executed on that node';
|
||||
|
||||
REVOKE ALL ON FUNCTION pg_catalog.citus_pause_node(int) FROM PUBLIC;
|
|
@ -1,9 +0,0 @@
|
|||
CREATE FUNCTION pg_catalog.citus_pause_node(node_id int)
|
||||
RETURNS void
|
||||
LANGUAGE C STRICT
|
||||
AS 'MODULE_PATHNAME', $$citus_pause_node$$;
|
||||
|
||||
COMMENT ON FUNCTION pg_catalog.citus_pause_node(node_id int)
|
||||
IS 'pauses node with given id which leads to add lock in tables and prevent any queries to be executed on that node';
|
||||
|
||||
REVOKE ALL ON FUNCTION pg_catalog.citus_pause_node(int) FROM PUBLIC;
|
|
@ -0,0 +1,9 @@
|
|||
CREATE FUNCTION pg_catalog.citus_pause_node_within_txn(node_id int)
|
||||
RETURNS void
|
||||
LANGUAGE C STRICT
|
||||
AS 'MODULE_PATHNAME', $$citus_pause_node_within_txn$$;
|
||||
|
||||
COMMENT ON FUNCTION pg_catalog.citus_pause_node_within_txn(node_id int)
|
||||
IS 'pauses node with given id which leads to add lock in tables and prevent any queries to be executed on that node';
|
||||
|
||||
REVOKE ALL ON FUNCTION pg_catalog.citus_pause_node_within_txn(int) FROM PUBLIC;
|
|
@ -0,0 +1,9 @@
|
|||
CREATE FUNCTION pg_catalog.citus_pause_node_within_txn(node_id int)
|
||||
RETURNS void
|
||||
LANGUAGE C STRICT
|
||||
AS 'MODULE_PATHNAME', $$citus_pause_node_within_txn$$;
|
||||
|
||||
COMMENT ON FUNCTION pg_catalog.citus_pause_node_within_txn(node_id int)
|
||||
IS 'pauses node with given id which leads to add lock in tables and prevent any queries to be executed on that node';
|
||||
|
||||
REVOKE ALL ON FUNCTION pg_catalog.citus_pause_node_within_txn(int) FROM PUBLIC;
|
|
@ -26,7 +26,7 @@ BEGIN
|
|||
-- Get the node id for the shard id
|
||||
SELECT nodeid into v_node_id FROM pg_dist_node WHERE nodename = v_node_name and nodeport = v_node_port limit 1;
|
||||
-- Pause the node
|
||||
perform pg_catalog.citus_pause_node(v_node_id) ;
|
||||
perform pg_catalog.citus_pause_node_within_txn(v_node_id) ;
|
||||
END;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
@ -50,13 +50,13 @@ step s2-insert-distributed:
|
|||
-- If we reach this point, the INSERT statement was successful
|
||||
v_insert_successful := TRUE;
|
||||
IF v_insert_successful THEN
|
||||
RAISE NOTICE 'INSERT statement completed successfully. This means that citus_pause_node could not get the lock.';
|
||||
RAISE NOTICE 'INSERT statement completed successfully. This means that citus_pause_node_within_txn could not get the lock.';
|
||||
END IF;
|
||||
-- You can add additional processing here if needed
|
||||
EXCEPTION
|
||||
WHEN query_canceled THEN
|
||||
-- The INSERT statement was canceled due to timeout
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node was able to get the lock.';
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node_within_txn was able to get the lock.';
|
||||
WHEN OTHERS THEN
|
||||
-- Any other exception raised during the INSERT statement
|
||||
RAISE;
|
||||
|
@ -65,7 +65,7 @@ step s2-insert-distributed:
|
|||
LANGUAGE plpgsql;
|
||||
<waiting ...>
|
||||
step s2-insert-distributed: <... completed>
|
||||
s2: NOTICE: query_canceled exception raised. This means that citus_pause_node was able to get the lock.
|
||||
s2: NOTICE: query_canceled exception raised. This means that citus_pause_node_within_txn was able to get the lock.
|
||||
step s2-end:
|
||||
COMMIT;
|
||||
|
||||
|
@ -99,7 +99,7 @@ BEGIN
|
|||
-- Get the node id for the shard id
|
||||
SELECT nodeid into v_node_id FROM pg_dist_node WHERE nodename = v_node_name and nodeport = v_node_port limit 1;
|
||||
-- Pause the node
|
||||
perform pg_catalog.citus_pause_node(v_node_id) ;
|
||||
perform pg_catalog.citus_pause_node_within_txn(v_node_id) ;
|
||||
END;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
@ -123,13 +123,13 @@ BEGIN
|
|||
-- If we reach this point, the DELETE statement was successful
|
||||
v_delete_successful := TRUE;
|
||||
IF v_delete_successful THEN
|
||||
RAISE NOTICE 'DELETE statement completed successfully. This means that citus_pause_node could not get the lock.';
|
||||
RAISE NOTICE 'DELETE statement completed successfully. This means that citus_pause_node_within_txn could not get the lock.';
|
||||
END IF;
|
||||
-- You can add additional processing here if needed
|
||||
EXCEPTION
|
||||
WHEN query_canceled THEN
|
||||
-- The INSERT statement was canceled due to timeout
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node was able to get the lock.';
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node_within_txn was able to get the lock.';
|
||||
WHEN OTHERS THEN
|
||||
-- Any other exception raised during the INSERT statement
|
||||
RAISE;
|
||||
|
@ -138,7 +138,7 @@ $$
|
|||
LANGUAGE plpgsql;
|
||||
<waiting ...>
|
||||
step s2-delete-distributed: <... completed>
|
||||
s2: NOTICE: query_canceled exception raised. This means that citus_pause_node was able to get the lock.
|
||||
s2: NOTICE: query_canceled exception raised. This means that citus_pause_node_within_txn was able to get the lock.
|
||||
step s2-end:
|
||||
COMMIT;
|
||||
|
||||
|
@ -172,7 +172,7 @@ BEGIN
|
|||
-- Get the node id for the shard id
|
||||
SELECT nodeid into v_node_id FROM pg_dist_node WHERE nodename = v_node_name and nodeport = v_node_port limit 1;
|
||||
-- Pause the node
|
||||
perform pg_catalog.citus_pause_node(v_node_id) ;
|
||||
perform pg_catalog.citus_pause_node_within_txn(v_node_id) ;
|
||||
END;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
@ -223,7 +223,7 @@ BEGIN
|
|||
-- Get the node id for the shard id
|
||||
SELECT nodeid into v_node_id FROM pg_dist_node WHERE nodename = v_node_name and nodeport = v_node_port limit 1;
|
||||
-- Pause the node
|
||||
perform pg_catalog.citus_pause_node(v_node_id) ;
|
||||
perform pg_catalog.citus_pause_node_within_txn(v_node_id) ;
|
||||
END;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
@ -247,11 +247,11 @@ BEGIN
|
|||
-- If we reach this point, the INSERT statement was successful
|
||||
v_insert_successful := TRUE;
|
||||
IF v_insert_successful THEN
|
||||
RAISE NOTICE 'INSERT statement completed successfully. This means that citus_pause_node could not get the lock.';
|
||||
RAISE NOTICE 'INSERT statement completed successfully. This means that citus_pause_node_within_txn could not get the lock.';
|
||||
END IF;
|
||||
EXCEPTION WHEN query_canceled THEN
|
||||
-- The INSERT statement was canceled due to timeout
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node was able to get the lock.';
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node_within_txn was able to get the lock.';
|
||||
WHEN OTHERS THEN
|
||||
-- Any other exception raised during the INSERT statement
|
||||
RAISE;
|
||||
|
@ -260,7 +260,7 @@ $$
|
|||
LANGUAGE plpgsql;
|
||||
<waiting ...>
|
||||
step s2-insert-reference: <... completed>
|
||||
s2: NOTICE: query_canceled exception raised. This means that citus_pause_node was able to get the lock.
|
||||
s2: NOTICE: query_canceled exception raised. This means that citus_pause_node_within_txn was able to get the lock.
|
||||
step s2-end:
|
||||
COMMIT;
|
||||
|
||||
|
@ -294,7 +294,7 @@ BEGIN
|
|||
-- Get the node id for the shard id
|
||||
SELECT nodeid into v_node_id FROM pg_dist_node WHERE nodename = v_node_name and nodeport = v_node_port limit 1;
|
||||
-- Pause the node
|
||||
perform pg_catalog.citus_pause_node(v_node_id) ;
|
||||
perform pg_catalog.citus_pause_node_within_txn(v_node_id) ;
|
||||
END;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
@ -323,7 +323,7 @@ BEGIN
|
|||
-- Get the node id for the shard id
|
||||
SELECT nodeid into v_node_id FROM pg_dist_node WHERE nodename = v_node_name and nodeport = v_node_port limit 1;
|
||||
-- Pause the node
|
||||
perform pg_catalog.citus_pause_node(v_node_id) ;
|
||||
perform pg_catalog.citus_pause_node_within_txn(v_node_id) ;
|
||||
END;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
@ -348,7 +348,7 @@ DECLARE
|
|||
v_expected_exception_message text := '';
|
||||
BEGIN
|
||||
select nextval('pg_dist_node_nodeid_seq')::int into v_node_id;
|
||||
select citus_pause_node(v_node_id);
|
||||
select citus_pause_node_within_txn(v_node_id);
|
||||
EXCEPTION
|
||||
WHEN SQLSTATE 'P0002' THEN
|
||||
GET STACKED DIAGNOSTICS v_exception_message = MESSAGE_TEXT;
|
||||
|
|
|
@ -59,7 +59,7 @@ step "s1-node-not-found"
|
|||
v_expected_exception_message text := '';
|
||||
BEGIN
|
||||
select nextval('pg_dist_node_nodeid_seq')::int into v_node_id;
|
||||
select citus_pause_node(v_node_id) ;
|
||||
select citus_pause_node_within_txn(v_node_id) ;
|
||||
EXCEPTION
|
||||
WHEN SQLSTATE 'P0002' THEN
|
||||
GET STACKED DIAGNOSTICS v_exception_message = MESSAGE_TEXT;
|
||||
|
@ -98,7 +98,7 @@ step "s1-pause-node"
|
|||
|
||||
|
||||
-- Pause the node
|
||||
perform pg_catalog.citus_pause_node(v_node_id) ;
|
||||
perform pg_catalog.citus_pause_node_within_txn(v_node_id) ;
|
||||
END;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
@ -136,7 +136,7 @@ step "s2-insert-distributed"
|
|||
v_insert_successful := TRUE;
|
||||
|
||||
IF v_insert_successful THEN
|
||||
RAISE NOTICE 'INSERT statement completed successfully. This means that citus_pause_node could not get the lock.';
|
||||
RAISE NOTICE 'INSERT statement completed successfully. This means that citus_pause_node_within_txn could not get the lock.';
|
||||
END IF;
|
||||
|
||||
|
||||
|
@ -144,7 +144,7 @@ step "s2-insert-distributed"
|
|||
EXCEPTION
|
||||
WHEN query_canceled THEN
|
||||
-- The INSERT statement was canceled due to timeout
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node was able to get the lock.';
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node_within_txn was able to get the lock.';
|
||||
WHEN OTHERS THEN
|
||||
-- Any other exception raised during the INSERT statement
|
||||
RAISE;
|
||||
|
@ -172,12 +172,12 @@ step "s2-insert-reference"{
|
|||
v_insert_successful := TRUE;
|
||||
|
||||
IF v_insert_successful THEN
|
||||
RAISE NOTICE 'INSERT statement completed successfully. This means that citus_pause_node could not get the lock.';
|
||||
RAISE NOTICE 'INSERT statement completed successfully. This means that citus_pause_node_within_txn could not get the lock.';
|
||||
END IF;
|
||||
|
||||
EXCEPTION WHEN query_canceled THEN
|
||||
-- The INSERT statement was canceled due to timeout
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node was able to get the lock.';
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node_within_txn was able to get the lock.';
|
||||
WHEN OTHERS THEN
|
||||
-- Any other exception raised during the INSERT statement
|
||||
RAISE;
|
||||
|
@ -209,13 +209,13 @@ step "s2-delete-distributed"{
|
|||
v_delete_successful := TRUE;
|
||||
|
||||
IF v_delete_successful THEN
|
||||
RAISE NOTICE 'DELETE statement completed successfully. This means that citus_pause_node could not get the lock.';
|
||||
RAISE NOTICE 'DELETE statement completed successfully. This means that citus_pause_node_within_txn could not get the lock.';
|
||||
END IF;
|
||||
-- You can add additional processing here if needed
|
||||
EXCEPTION
|
||||
WHEN query_canceled THEN
|
||||
-- The INSERT statement was canceled due to timeout
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node was able to get the lock.';
|
||||
RAISE NOTICE 'query_canceled exception raised. This means that citus_pause_node_within_txn was able to get the lock.';
|
||||
WHEN OTHERS THEN
|
||||
-- Any other exception raised during the INSERT statement
|
||||
RAISE;
|
||||
|
|
Loading…
Reference in New Issue