Fix current failing test

pull/5899/head
gledis69 2022-04-20 17:47:37 +03:00
parent 1f926db4fa
commit a250c4f350
10 changed files with 27 additions and 9 deletions

View File

@ -105,5 +105,3 @@ GRANT SELECT ON pg_catalog.pg_dist_object TO public;
#include "udfs/citus_pid_for_gpid/11.0-1.sql"
#include "udfs/citus_coordinator_nodeid/11.0-1.sql"
#include "udfs/lock_relation_if_exists/11.0-1.sql"

View File

@ -6,3 +6,6 @@ DROP FUNCTION pg_catalog.worker_hash_partition_table(bigint, integer, text, text
DROP FUNCTION pg_catalog.worker_merge_files_into_table(bigint, integer, text[], text[]);
DROP FUNCTION pg_catalog.worker_range_partition_table(bigint, integer, text, text, oid, anyarray);
DROP FUNCTION pg_catalog.worker_repartition_cleanup(bigint);
DROP FUNCTION pg_catalog.lock_relation_if_exists(text, text);
#include "udfs/lock_relation_if_exists/11.1-1.sql"

View File

@ -372,3 +372,4 @@ DROP FUNCTION pg_catalog.citus_nodeid_for_gpid(bigint);
DROP FUNCTION pg_catalog.citus_pid_for_gpid(bigint);
DROP FUNCTION pg_catalog.citus_coordinator_nodeid();

View File

@ -45,3 +45,12 @@ CREATE FUNCTION pg_catalog.worker_repartition_cleanup(bigint)
LANGUAGE c
STRICT
AS 'MODULE_PATHNAME', $function$worker_repartition_cleanup$function$
DROP FUNCTION pg_catalog.lock_relation_if_exists(text, text, boolean);
CREATE OR REPLACE FUNCTION pg_catalog.lock_relation_if_exists(table_name text, lock_mode text)
RETURNS BOOL
LANGUAGE C STRICT as 'MODULE_PATHNAME',
$$lock_relation_if_exists$$;
COMMENT ON FUNCTION pg_catalog.lock_relation_if_exists(table_name text, lock_mode text)
IS 'locks relation in the lock_mode if the relation exists';

View File

@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION pg_catalog.lock_relation_if_exists(table_name text, lock_mode text, nowait boolean)
CREATE OR REPLACE FUNCTION pg_catalog.lock_relation_if_exists(table_name text, lock_mode text, nowait boolean default False)
RETURNS BOOL
LANGUAGE C STRICT as 'MODULE_PATHNAME',
$$lock_relation_if_exists$$;

View File

@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION pg_catalog.lock_relation_if_exists(table_name text, lock_mode text, nowait boolean)
CREATE OR REPLACE FUNCTION pg_catalog.lock_relation_if_exists(table_name text, lock_mode text, nowait boolean default False)
RETURNS BOOL
LANGUAGE C STRICT as 'MODULE_PATHNAME',
$$lock_relation_if_exists$$;

View File

@ -1034,8 +1034,9 @@ SELECT * FROM multi_extension.print_extension_changes();
-- Snapshot of state at 11.1-1
ALTER EXTENSION citus UPDATE TO '11.1-1';
SELECT * FROM multi_extension.print_extension_changes();
previous_object | current_object
previous_object | current_object
---------------------------------------------------------------------
function lock_relation_if_exists(text,text) boolean |
function worker_cleanup_job_schema_cache() void |
function worker_create_schema(bigint,text) void |
function worker_fetch_foreign_file(text,text,bigint,text[],integer[]) void |
@ -1044,7 +1045,8 @@ SELECT * FROM multi_extension.print_extension_changes();
function worker_merge_files_into_table(bigint,integer,text[],text[]) void |
function worker_range_partition_table(bigint,integer,text,text,oid,anyarray) void |
function worker_repartition_cleanup(bigint) void |
(8 rows)
| function lock_relation_if_exists(text,text,boolean) boolean
(10 rows)
DROP TABLE multi_extension.prev_objects, multi_extension.extension_diff;
-- show running version

View File

@ -73,7 +73,12 @@ SELECT * FROM citus_shard_indexes_on_worker WHERE "Schema" = 'mx_hide_shard_name
-- make sure that pg_class queries do not get blocked on table locks
begin;
lock table test_table in access exclusive mode;
SELECT lock_relation_if_exists('test_table', 'ACCESS EXCLUSIVE');
lock_relation_if_exists
---------------------------------------------------------------------
t
(1 row)
prepare transaction 'take-aggressive-lock';
-- shards are hidden when using psql as application_name
SELECT relname FROM pg_catalog.pg_class WHERE relnamespace = 'mx_hide_shard_names'::regnamespace ORDER BY relname;

View File

@ -158,7 +158,7 @@ ORDER BY 1;
function isolate_tenant_to_new_shard(regclass,"any",text)
function json_cat_agg(json)
function jsonb_cat_agg(jsonb)
function lock_relation_if_exists(text,text)
function lock_relation_if_exists(text,text,boolean)
function lock_shard_metadata(integer,bigint[])
function lock_shard_resources(integer,bigint[])
function master_activate_node(text,integer)

View File

@ -43,7 +43,7 @@ SELECT * FROM citus_shard_indexes_on_worker WHERE "Schema" = 'mx_hide_shard_name
-- make sure that pg_class queries do not get blocked on table locks
begin;
lock table test_table in access exclusive mode;
SELECT lock_relation_if_exists('test_table', 'ACCESS EXCLUSIVE');
prepare transaction 'take-aggressive-lock';
-- shards are hidden when using psql as application_name