From 0fbddc740d7e87f21f4144da6e5b27a022297b38 Mon Sep 17 00:00:00 2001 From: Ahmet Gedemenli Date: Tue, 1 Jun 2021 17:16:40 +0300 Subject: [PATCH] Fix shard id difference for enterprise --- src/test/regress/expected/multi_partitioning.out | 13 +++++++------ src/test/regress/sql/multi_partitioning.sql | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/test/regress/expected/multi_partitioning.out b/src/test/regress/expected/multi_partitioning.out index bece8046e..dfcc422b7 100644 --- a/src/test/regress/expected/multi_partitioning.out +++ b/src/test/regress/expected/multi_partitioning.out @@ -1947,6 +1947,7 @@ ORDER BY "schema-test_2009" | 4 (2 rows) +SET citus.next_shard_id TO 1660300; -- test we don't deadlock when attaching and detaching partitions from partitioned -- tables with foreign keys CREATE TABLE reference_table(id int PRIMARY KEY); @@ -2001,8 +2002,8 @@ INSERT INTO partitioning_test_2010 VALUES (1, '2010-02-01'); -- This should fail because of foreign key constraint violation ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2010 FOR VALUES FROM ('2010-01-01') TO ('2011-01-01'); -ERROR: insert or update on table "partitioning_test_2010_1660191" violates foreign key constraint "partitioning_reference_fkey_1660179" -DETAIL: Key (id)=(X) is not present in table "reference_table_1660177". +ERROR: insert or update on table "partitioning_test_2010_1660314" violates foreign key constraint "partitioning_reference_fkey_1660302" +DETAIL: Key (id)=(X) is not present in table "reference_table_1660300". CONTEXT: while executing command on localhost:xxxxx -- Truncate, so attaching again won't fail TRUNCATE partitioning_test_2010; @@ -2093,14 +2094,14 @@ DETAIL: Table "" is modified, which might lead to data inconsistencies CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name)" PL/pgSQL function citus_drop_trigger() line 16 at PERFORM DEBUG: drop cascades to 2 other objects -DETAIL: drop cascades to constraint partitioning_reference_fkey_1660179 on table partitioning_schema.partitioning_test_1660179 -drop cascades to constraint partitioning_reference_fkey_1660181 on table partitioning_schema.partitioning_test_1660181 +DETAIL: drop cascades to constraint partitioning_reference_fkey_1660302 on table partitioning_schema.partitioning_test_1660302 +drop cascades to constraint partitioning_reference_fkey_1660304 on table partitioning_schema.partitioning_test_1660304 DETAIL: from localhost:xxxxx CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name)" PL/pgSQL function citus_drop_trigger() line 16 at PERFORM DEBUG: drop cascades to 2 other objects -DETAIL: drop cascades to constraint partitioning_reference_fkey_1660180 on table partitioning_schema.partitioning_test_1660180 -drop cascades to constraint partitioning_reference_fkey_1660182 on table partitioning_schema.partitioning_test_1660182 +DETAIL: drop cascades to constraint partitioning_reference_fkey_1660303 on table partitioning_schema.partitioning_test_1660303 +drop cascades to constraint partitioning_reference_fkey_1660305 on table partitioning_schema.partitioning_test_1660305 DETAIL: from localhost:xxxxx CONTEXT: SQL statement "SELECT citus_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name)" PL/pgSQL function citus_drop_trigger() line 16 at PERFORM diff --git a/src/test/regress/sql/multi_partitioning.sql b/src/test/regress/sql/multi_partitioning.sql index d86f583bc..8c905f944 100644 --- a/src/test/regress/sql/multi_partitioning.sql +++ b/src/test/regress/sql/multi_partitioning.sql @@ -1164,6 +1164,7 @@ GROUP BY ORDER BY 1,2; +SET citus.next_shard_id TO 1660300; -- test we don't deadlock when attaching and detaching partitions from partitioned -- tables with foreign keys