From 2276e993470d4f8d0ec5fe590c5ec8d896cddff1 Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Mon, 19 Dec 2016 09:31:07 +0200 Subject: [PATCH] Improve regression tests for multi_colocated_shard_transfer Ensure that regression tests outputs are consistent for multi_colocated_shard_transfer. --- .../multi_colocated_shard_transfer.out | 52 +++++++++---------- .../sql/multi_colocated_shard_transfer.sql | 16 +++--- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/test/regress/expected/multi_colocated_shard_transfer.out b/src/test/regress/expected/multi_colocated_shard_transfer.out index a1193b4fd..fab3190bf 100644 --- a/src/test/regress/expected/multi_colocated_shard_transfer.out +++ b/src/test/regress/expected/multi_colocated_shard_transfer.out @@ -16,23 +16,23 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND colocationid = (SELECT colocationid FROM pg_dist_partition WHERE logicalrelid = 'table1_group1'::regclass) -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; shardid | logicalrelid | nodeport | colocationid | shardstate ---------+---------------+----------+--------------+------------ - 1300000 | table1_group1 | 57638 | 1000 | 3 1300000 | table1_group1 | 57637 | 1000 | 1 + 1300000 | table1_group1 | 57638 | 1000 | 3 1300001 | table1_group1 | 57637 | 1000 | 1 1300001 | table1_group1 | 57638 | 1000 | 1 - 1300002 | table1_group1 | 57638 | 1000 | 1 1300002 | table1_group1 | 57637 | 1000 | 1 + 1300002 | table1_group1 | 57638 | 1000 | 1 1300003 | table1_group1 | 57637 | 1000 | 1 1300003 | table1_group1 | 57638 | 1000 | 1 - 1300004 | table2_group1 | 57638 | 1000 | 3 1300004 | table2_group1 | 57637 | 1000 | 1 + 1300004 | table2_group1 | 57638 | 1000 | 3 1300005 | table2_group1 | 57637 | 1000 | 1 1300005 | table2_group1 | 57638 | 1000 | 1 - 1300006 | table2_group1 | 57638 | 1000 | 1 1300006 | table2_group1 | 57637 | 1000 | 1 + 1300006 | table2_group1 | 57638 | 1000 | 1 1300007 | table2_group1 | 57637 | 1000 | 1 1300007 | table2_group1 | 57638 | 1000 | 1 (16 rows) @@ -52,23 +52,23 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND colocationid = (SELECT colocationid FROM pg_dist_partition WHERE logicalrelid = 'table1_group1'::regclass) -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; shardid | logicalrelid | nodeport | colocationid | shardstate ---------+---------------+----------+--------------+------------ - 1300000 | table1_group1 | 57638 | 1000 | 1 1300000 | table1_group1 | 57637 | 1000 | 1 + 1300000 | table1_group1 | 57638 | 1000 | 1 1300001 | table1_group1 | 57637 | 1000 | 1 1300001 | table1_group1 | 57638 | 1000 | 1 - 1300002 | table1_group1 | 57638 | 1000 | 1 1300002 | table1_group1 | 57637 | 1000 | 1 + 1300002 | table1_group1 | 57638 | 1000 | 1 1300003 | table1_group1 | 57637 | 1000 | 1 1300003 | table1_group1 | 57638 | 1000 | 1 - 1300004 | table2_group1 | 57638 | 1000 | 3 1300004 | table2_group1 | 57637 | 1000 | 1 + 1300004 | table2_group1 | 57638 | 1000 | 3 1300005 | table2_group1 | 57637 | 1000 | 1 1300005 | table2_group1 | 57638 | 1000 | 1 - 1300006 | table2_group1 | 57638 | 1000 | 1 1300006 | table2_group1 | 57637 | 1000 | 1 + 1300006 | table2_group1 | 57638 | 1000 | 1 1300007 | table2_group1 | 57637 | 1000 | 1 1300007 | table2_group1 | 57638 | 1000 | 1 (16 rows) @@ -82,7 +82,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND p.logicalrelid = 'table5_groupX'::regclass -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; shardid | logicalrelid | nodeport | colocationid | shardstate ---------+---------------+----------+--------------+------------ 1300016 | table5_groupx | 57637 | 0 | 1 @@ -91,8 +91,8 @@ ORDER BY s.shardid; 1300017 | table5_groupx | 57638 | 0 | 1 1300018 | table5_groupx | 57637 | 0 | 1 1300018 | table5_groupx | 57638 | 0 | 1 - 1300019 | table5_groupx | 57638 | 0 | 1 1300019 | table5_groupx | 57637 | 0 | 1 + 1300019 | table5_groupx | 57638 | 0 | 1 (8 rows) -- repair NOT colocated shard @@ -110,7 +110,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND p.logicalrelid = 'table5_groupX'::regclass -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; shardid | logicalrelid | nodeport | colocationid | shardstate ---------+---------------+----------+--------------+------------ 1300016 | table5_groupx | 57637 | 0 | 1 @@ -119,8 +119,8 @@ ORDER BY s.shardid; 1300017 | table5_groupx | 57638 | 0 | 1 1300018 | table5_groupx | 57637 | 0 | 1 1300018 | table5_groupx | 57638 | 0 | 1 - 1300019 | table5_groupx | 57638 | 0 | 1 1300019 | table5_groupx | 57637 | 0 | 1 + 1300019 | table5_groupx | 57638 | 0 | 1 (8 rows) -- test repairing shard in append distributed table @@ -132,7 +132,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND p.logicalrelid = 'table6_append'::regclass -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; shardid | logicalrelid | nodeport | colocationid | shardstate ---------+---------------+----------+--------------+------------ 1300020 | table6_append | 57637 | 0 | 1 @@ -156,7 +156,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND p.logicalrelid = 'table6_append'::regclass -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; shardid | logicalrelid | nodeport | colocationid | shardstate ---------+---------------+----------+--------------+------------ 1300020 | table6_append | 57637 | 0 | 1 @@ -176,23 +176,23 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND colocationid = (SELECT colocationid FROM pg_dist_partition WHERE logicalrelid = 'table1_group1'::regclass) -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; shardid | logicalrelid | nodeport | colocationid | shardstate ---------+---------------+----------+--------------+------------ - 1300000 | table1_group1 | 57638 | 1000 | 3 1300000 | table1_group1 | 57637 | 1000 | 3 + 1300000 | table1_group1 | 57638 | 1000 | 3 1300001 | table1_group1 | 57637 | 1000 | 1 1300001 | table1_group1 | 57638 | 1000 | 1 - 1300002 | table1_group1 | 57638 | 1000 | 1 1300002 | table1_group1 | 57637 | 1000 | 1 + 1300002 | table1_group1 | 57638 | 1000 | 1 1300003 | table1_group1 | 57637 | 1000 | 1 1300003 | table1_group1 | 57638 | 1000 | 1 - 1300004 | table2_group1 | 57638 | 1000 | 3 1300004 | table2_group1 | 57637 | 1000 | 1 + 1300004 | table2_group1 | 57638 | 1000 | 3 1300005 | table2_group1 | 57637 | 1000 | 1 1300005 | table2_group1 | 57638 | 1000 | 1 - 1300006 | table2_group1 | 57638 | 1000 | 1 1300006 | table2_group1 | 57637 | 1000 | 1 + 1300006 | table2_group1 | 57638 | 1000 | 1 1300007 | table2_group1 | 57637 | 1000 | 1 1300007 | table2_group1 | 57638 | 1000 | 1 (16 rows) @@ -208,23 +208,23 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND colocationid = (SELECT colocationid FROM pg_dist_partition WHERE logicalrelid = 'table1_group1'::regclass) -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; shardid | logicalrelid | nodeport | colocationid | shardstate ---------+---------------+----------+--------------+------------ - 1300000 | table1_group1 | 57638 | 1000 | 3 1300000 | table1_group1 | 57637 | 1000 | 3 + 1300000 | table1_group1 | 57638 | 1000 | 3 1300001 | table1_group1 | 57637 | 1000 | 1 1300001 | table1_group1 | 57638 | 1000 | 1 - 1300002 | table1_group1 | 57638 | 1000 | 1 1300002 | table1_group1 | 57637 | 1000 | 1 + 1300002 | table1_group1 | 57638 | 1000 | 1 1300003 | table1_group1 | 57637 | 1000 | 1 1300003 | table1_group1 | 57638 | 1000 | 1 - 1300004 | table2_group1 | 57638 | 1000 | 3 1300004 | table2_group1 | 57637 | 1000 | 1 + 1300004 | table2_group1 | 57638 | 1000 | 3 1300005 | table2_group1 | 57637 | 1000 | 1 1300005 | table2_group1 | 57638 | 1000 | 1 - 1300006 | table2_group1 | 57638 | 1000 | 1 1300006 | table2_group1 | 57637 | 1000 | 1 + 1300006 | table2_group1 | 57638 | 1000 | 1 1300007 | table2_group1 | 57637 | 1000 | 1 1300007 | table2_group1 | 57638 | 1000 | 1 (16 rows) diff --git a/src/test/regress/sql/multi_colocated_shard_transfer.sql b/src/test/regress/sql/multi_colocated_shard_transfer.sql index 5ce35e94e..4b331175c 100644 --- a/src/test/regress/sql/multi_colocated_shard_transfer.sql +++ b/src/test/regress/sql/multi_colocated_shard_transfer.sql @@ -20,7 +20,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND colocationid = (SELECT colocationid FROM pg_dist_partition WHERE logicalrelid = 'table1_group1'::regclass) -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; -- repair colocated shards SELECT master_copy_shard_placement(1300000, 'localhost', :worker_1_port, 'localhost', :worker_2_port); @@ -33,7 +33,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND colocationid = (SELECT colocationid FROM pg_dist_partition WHERE logicalrelid = 'table1_group1'::regclass) -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; -- test repairing NOT colocated shard @@ -45,7 +45,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND p.logicalrelid = 'table5_groupX'::regclass -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; -- repair NOT colocated shard SELECT master_copy_shard_placement(1300016, 'localhost', :worker_1_port, 'localhost', :worker_2_port); @@ -58,7 +58,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND p.logicalrelid = 'table5_groupX'::regclass -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; -- test repairing shard in append distributed table @@ -70,7 +70,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND p.logicalrelid = 'table6_append'::regclass -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; -- repair shard in append distributed table SELECT master_copy_shard_placement(1300020, 'localhost', :worker_1_port, 'localhost', :worker_2_port); @@ -83,7 +83,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND p.logicalrelid = 'table6_append'::regclass -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; -- test repair while all placements of one shard in colocation group is unhealthy @@ -98,7 +98,7 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND colocationid = (SELECT colocationid FROM pg_dist_partition WHERE logicalrelid = 'table1_group1'::regclass) -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport; -- repair while all placements of one shard in colocation group is unhealthy SELECT master_copy_shard_placement(1300000, 'localhost', :worker_1_port, 'localhost', :worker_2_port); @@ -111,4 +111,4 @@ WHERE p.logicalrelid = s.logicalrelid AND s.shardid = sp.shardid AND colocationid = (SELECT colocationid FROM pg_dist_partition WHERE logicalrelid = 'table1_group1'::regclass) -ORDER BY s.shardid; +ORDER BY s.shardid, sp.nodeport;