Skip to content

Commit 4e80654

Browse files
committed
CI: add binary swap testing workflow for REL_2_STABLE
Add comprehensive binary swap CI testing for REL_2_STABLE branch: 1. Update test_binary_swap.sh script for testing 2. Integrate with parallel build workflows 3. Add the upgrading_compatibility for robust testing
1 parent 8178d4f commit 4e80654

36 files changed

+17806
-41
lines changed

.github/workflows/binary-swap-check.yml

Lines changed: 732 additions & 0 deletions
Large diffs are not rendered by default.

src/test/binary_swap/expected/resgroup_current_1_group.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ select groupname from gp_toolkit.gp_resgroup_config
3434
rg2
3535
(4 rows)
3636

37-
select rsgname from gp_toolkit.gp_resgroup_status
38-
where rsgname not like 'rg_dump_test%'
37+
select groupname from gp_toolkit.gp_resgroup_status
38+
where groupname not like 'rg_dump_test%'
3939
order by groupid;
40-
rsgname
41-
---------------
40+
groupname
41+
-----------------
4242
default_group
4343
admin_group
4444
rg1

src/test/binary_swap/expected/resgroup_current_1_queue.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ select groupname from gp_toolkit.gp_resgroup_config
3232
system_group
3333
(3 rows)
3434

35-
select rsgname from gp_toolkit.gp_resgroup_status
36-
where rsgname not like 'rg_dump_test%'
35+
select groupname from gp_toolkit.gp_resgroup_status
36+
where groupname not like 'rg_dump_test%'
3737
order by groupid;
38-
rsgname
39-
---------
38+
groupname
39+
-----------
4040
(0 rows)
4141

4242
create resource group rg1 with (cpu_max_percent=10, memory_quota=10);

src/test/binary_swap/expected/resgroup_current_3_group.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ select groupname from gp_toolkit.gp_resgroup_config
3434
rg2
3535
(4 rows)
3636

37-
select rsgname from gp_toolkit.gp_resgroup_status
38-
where rsgname not like 'rg_dump_test%'
37+
select groupname from gp_toolkit.gp_resgroup_status
38+
where groupname not like 'rg_dump_test%'
3939
order by groupid;
40-
rsgname
41-
---------------
40+
groupname
41+
-----------------
4242
default_group
4343
admin_group
4444
rg1

src/test/binary_swap/expected/resgroup_current_3_queue.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ select groupname from gp_toolkit.gp_resgroup_config
3636
rg1
3737
(5 rows)
3838

39-
select rsgname from gp_toolkit.gp_resgroup_status
40-
where rsgname not like 'rg_dump_test%'
39+
select groupname from gp_toolkit.gp_resgroup_status
40+
where groupname not like 'rg_dump_test%'
4141
order by groupid;
42-
rsgname
43-
---------
42+
groupname
43+
-----------
4444
(0 rows)
4545

4646
alter resource group rg1 set cpu_max_percent 20;

src/test/binary_swap/expected/resgroup_other_2_group.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ select groupname from gp_toolkit.gp_resgroup_config
3434
rg2
3535
(4 rows)
3636

37-
select rsgname from gp_toolkit.gp_resgroup_status
38-
where rsgname not like 'rg_dump_test%'
37+
select groupname from gp_toolkit.gp_resgroup_status
38+
where groupname not like 'rg_dump_test%'
3939
order by groupid;
40-
rsgname
41-
---------------
40+
groupname
41+
-----------------
4242
default_group
4343
admin_group
4444
rg1

src/test/binary_swap/expected/resgroup_other_2_queue.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ select groupname from gp_toolkit.gp_resgroup_config
3636
rg2
3737
(5 rows)
3838

39-
select rsgname from gp_toolkit.gp_resgroup_status
40-
where rsgname not like 'rg_dump_test%'
39+
select groupname from gp_toolkit.gp_resgroup_status
40+
where groupname not like 'rg_dump_test%'
4141
order by groupid;
42-
rsgname
43-
---------
42+
groupname
43+
-----------
4444
(0 rows)
4545

4646
alter resource group rg1 set cpu_max_percent 20;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-- Create Indexes
2+
-- B-tree
3+
CREATE INDEX btree_idx_sales_heap_1 ON sales_heap(product_id);
4+
CREATE INDEX btree_idx_sales_heap_2 ON sales_heap(customer_name);
5+
CREATE INDEX btree_idx_sales_ao_1 ON sales_ao(product_id);
6+
CREATE INDEX btree_idx_sales_ao_2 ON sales_ao(customer_name);
7+
CREATE INDEX btree_idx_sales_aocs_1 ON sales_aocs(product_id);
8+
CREATE INDEX btree_idx_sales_aocs_2 ON sales_aocs(product_id, sale_date);
9+
CREATE INDEX btree_idx_sales_partition_heap_1 ON sales_partition_heap(product_id);
10+
CREATE INDEX btree_idx_sales_partition_heap_2 ON sales_partition_heap(customer_name);
11+
CREATE INDEX btree_idx_sales_partition_ao_1 ON sales_partition_ao(product_id);
12+
CREATE INDEX btree_idx_sales_partition_ao_2 ON sales_partition_ao(product_id, sale_date);
13+
CREATE INDEX btree_idx_sales_partition_ao_3 ON sales_partition_ao(customer_name);
14+
CREATE INDEX btree_idx_sales_partition_aocs1 ON sales_partition_aocs(product_id);
15+
CREATE INDEX btree_idx_sales_partition_aocs2 ON sales_partition_aocs(customer_name, product_id);
16+
-- Unique
17+
CREATE UNIQUE INDEX on sales_ao(product_id);
18+
CREATE UNIQUE INDEX on sales_aocs(product_id,description);
19+
CREATE UNIQUE INDEX on sales_partition_ao(product_id,order_date);
20+
-- CREATE UNIQUE INDEX on sales_partition_aocs(product_id,description); blocked by issue #557
21+
-- Bitmap
22+
CREATE INDEX bmp_idx_sales_ao ON sales_ao USING bitmap(is_audited);
23+
CREATE INDEX bmp_idx_sales_partition_aocs ON sales_partition_aocs USING bitmap(status);
24+
CREATE INDEX bmp_idx_sales_heap ON sales_heap USING bitmap(status);
25+
-- Brin
26+
-- CREATE INDEX brin_idx_sales_ao ON sales_ao USING brin (sale_date) with (pages_per_range = 1); blocked by issue #558
27+
CREATE INDEX brin_idx_sales_partition_heap ON sales_partition_heap USING brin (sale_date) with (pages_per_range = 1);
28+
-- CREATE INDEX brin_idx_sales_aocs ON sales_aocs USING brin (sale_date) with (pages_per_range = 1); blocked by issue #558
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
-- Create various types of tables for migration compatibility test
2+
--
3+
-- List of tables in Summary
4+
-- Name | Type | Partition by | Storage
5+
------------------------------+-------------------+--------------+----------------------
6+
-- sales_ao | table | | append only
7+
-- sales_aocs | table | | append only columnar
8+
-- sales_heap | table | | heap
9+
-- sales_partition_ao | partitioned table | range |
10+
-- sales_partition_aocs | partitioned table | hash |
11+
-- sales_partition_heap | partitioned table | list |
12+
-- sales_partition_ao_part1 | table | | append only
13+
-- sales_partition_ao_part2 | table | | append only
14+
-- sales_partition_ao_part3 | table | | append only
15+
-- sales_partition_aocs_part1 | table | | append only columnar
16+
-- sales_partition_aocs_part2 | table | | append only columnar
17+
-- sales_partition_aocs_part3 | table | | append only columnar
18+
-- sales_partition_heap_part1 | table | | heap
19+
-- sales_partition_heap_part2 | table | | heap
20+
-- sales_partition_heap_part3 | table | | heap
21+
--
22+
-- Heap Table
23+
DROP TABLE IF EXISTS sales_heap;
24+
NOTICE: table "sales_heap" does not exist, skipping
25+
CREATE TABLE IF NOT EXISTS sales_heap
26+
(
27+
product_id INT,
28+
is_audited BOOLEAN DEFAULT FALSE,
29+
quantity SMALLINT,
30+
total_sales BIGINT,
31+
unit_price REAL,
32+
discount DOUBLE PRECISION,
33+
description TEXT,
34+
sale_date TIMESTAMP,
35+
order_date DATE,
36+
status CHAR(10),
37+
customer_name VARCHAR(20),
38+
price DECIMAL(20, 10)
39+
)
40+
DISTRIBUTED BY (product_id);
41+
-- Heap Table, Partition by LIST
42+
DROP TABLE IF EXISTS sales_partition_heap;
43+
NOTICE: table "sales_partition_heap" does not exist, skipping
44+
CREATE TABLE IF NOT EXISTS sales_partition_heap
45+
(
46+
product_id INT,
47+
is_audited BOOLEAN DEFAULT FALSE,
48+
quantity SMALLINT,
49+
total_sales BIGINT,
50+
unit_price REAL,
51+
discount DOUBLE PRECISION,
52+
description TEXT,
53+
sale_date TIMESTAMP,
54+
order_date DATE,
55+
status CHAR(10),
56+
customer_name VARCHAR(20),
57+
price DECIMAL(20, 10)
58+
)
59+
DISTRIBUTED BY (product_id)
60+
PARTITION BY LIST (status);
61+
CREATE TABLE sales_partition_heap_part1
62+
PARTITION OF sales_partition_heap
63+
FOR VALUES IN ('Cancelled');
64+
NOTICE: table has parent, setting distribution columns to match parent table
65+
CREATE TABLE sales_partition_heap_part2
66+
PARTITION OF sales_partition_heap
67+
FOR VALUES IN ('Closed');
68+
NOTICE: table has parent, setting distribution columns to match parent table
69+
CREATE TABLE sales_partition_heap_part3
70+
PARTITION OF sales_partition_heap
71+
FOR VALUES IN ('Processing');
72+
NOTICE: table has parent, setting distribution columns to match parent table
73+
-- AO Table
74+
DROP TABLE IF EXISTS sales_ao;
75+
NOTICE: table "sales_ao" does not exist, skipping
76+
CREATE TABLE IF NOT EXISTS sales_ao
77+
(
78+
product_id INT,
79+
is_audited BOOLEAN DEFAULT FALSE,
80+
quantity SMALLINT,
81+
total_sales BIGINT,
82+
unit_price REAL,
83+
discount DOUBLE PRECISION,
84+
description TEXT,
85+
sale_date TIMESTAMP,
86+
order_date DATE,
87+
status CHAR(10),
88+
customer_name VARCHAR(20),
89+
price DECIMAL(20, 10)
90+
)
91+
WITH (appendonly=true)
92+
DISTRIBUTED BY (product_id);
93+
-- AO Table, Partition by Range
94+
DROP TABLE IF EXISTS sales_partition_ao;
95+
NOTICE: table "sales_partition_ao" does not exist, skipping
96+
CREATE TABLE IF NOT EXISTS sales_partition_ao
97+
(
98+
product_id INT,
99+
is_audited BOOLEAN DEFAULT FALSE,
100+
quantity SMALLINT,
101+
total_sales BIGINT,
102+
unit_price REAL,
103+
discount DOUBLE PRECISION,
104+
description TEXT,
105+
sale_date TIMESTAMP,
106+
order_date DATE,
107+
status CHAR(10),
108+
customer_name VARCHAR(20),
109+
price DECIMAL(20, 10)
110+
)
111+
DISTRIBUTED BY (product_id)
112+
PARTITION BY RANGE (order_date);
113+
CREATE TABLE sales_partition_ao_part1
114+
PARTITION OF sales_partition_ao
115+
FOR VALUES FROM ('2023-01-01') TO ('2024-01-01')
116+
WITH (appendonly=true);
117+
NOTICE: table has parent, setting distribution columns to match parent table
118+
CREATE TABLE sales_partition_ao_part2
119+
PARTITION OF sales_partition_ao
120+
FOR VALUES FROM ('2024-01-01') TO ('2025-01-01')
121+
WITH (appendonly=true);
122+
NOTICE: table has parent, setting distribution columns to match parent table
123+
CREATE TABLE sales_partition_ao_part3
124+
PARTITION OF sales_partition_ao
125+
FOR VALUES FROM ('2025-01-01') TO ('2026-01-01')
126+
WITH (appendonly=true);
127+
NOTICE: table has parent, setting distribution columns to match parent table
128+
-- AOCS Table
129+
DROP TABLE IF EXISTS sales_aocs;
130+
NOTICE: table "sales_aocs" does not exist, skipping
131+
CREATE TABLE IF NOT EXISTS sales_aocs
132+
(
133+
product_id INT,
134+
is_audited BOOLEAN DEFAULT FALSE,
135+
quantity SMALLINT,
136+
total_sales BIGINT,
137+
unit_price REAL,
138+
discount DOUBLE PRECISION,
139+
description TEXT,
140+
sale_date TIMESTAMP,
141+
order_date DATE,
142+
status CHAR(10),
143+
customer_name VARCHAR(20),
144+
price DECIMAL(20, 10)
145+
)
146+
WITH (appendonly=true, orientation=column)
147+
DISTRIBUTED BY (product_id);
148+
-- AOCS Table, Partition by Hash
149+
DROP TABLE IF EXISTS sales_partition_aocs;
150+
NOTICE: table "sales_partition_aocs" does not exist, skipping
151+
CREATE TABLE IF NOT EXISTS sales_partition_aocs
152+
(
153+
product_id INT,
154+
is_audited BOOLEAN DEFAULT FALSE,
155+
quantity SMALLINT,
156+
total_sales BIGINT,
157+
unit_price REAL,
158+
discount DOUBLE PRECISION,
159+
description TEXT,
160+
sale_date TIMESTAMP,
161+
order_date DATE,
162+
status CHAR(10),
163+
customer_name VARCHAR(20),
164+
price DECIMAL(20, 10)
165+
)
166+
DISTRIBUTED BY (product_id)
167+
PARTITION BY HASH(description);
168+
CREATE TABLE sales_partition_aocs_part1
169+
PARTITION OF sales_partition_aocs
170+
FOR VALUES WITH (MODULUS 3, REMAINDER 0)
171+
WITH (appendonly=true, orientation=column);
172+
NOTICE: table has parent, setting distribution columns to match parent table
173+
CREATE TABLE sales_partition_aocs_part2
174+
PARTITION OF sales_partition_aocs
175+
FOR VALUES WITH (MODULUS 3, REMAINDER 1)
176+
WITH (appendonly=true, orientation=column);
177+
NOTICE: table has parent, setting distribution columns to match parent table
178+
CREATE TABLE sales_partition_aocs_part3
179+
PARTITION OF sales_partition_aocs
180+
FOR VALUES WITH (MODULUS 3, REMAINDER 2)
181+
WITH (appendonly=true, orientation=column);
182+
NOTICE: table has parent, setting distribution columns to match parent table
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
DELETE FROM sales_heap WHERE product_id > 1000000;
2+
DELETE FROM sales_ao WHERE product_id > 1000000;
3+
DELETE FROM sales_aocs WHERE product_id > 1000000;
4+
DELETE FROM sales_partition_heap WHERE product_id > 1000000;
5+
DELETE FROM sales_partition_ao WHERE product_id > 1000000;
6+
DELETE FROM sales_partition_aocs WHERE product_id > 1000000;
7+
SELECT COUNT(*) FROM sales_heap;
8+
count
9+
-------
10+
10000
11+
(1 row)
12+
13+
SELECT COUNT(*) FROM sales_ao;
14+
count
15+
-------
16+
10000
17+
(1 row)
18+
19+
SELECT COUNT(*) FROM sales_aocs;
20+
count
21+
-------
22+
10000
23+
(1 row)
24+
25+
SELECT COUNT(*) FROM sales_partition_heap;
26+
count
27+
-------
28+
10000
29+
(1 row)
30+
31+
SELECT COUNT(*) FROM sales_partition_ao;
32+
count
33+
-------
34+
10000
35+
(1 row)
36+
37+
SELECT COUNT(*) FROM sales_partition_aocs;
38+
count
39+
-------
40+
10000
41+
(1 row)
42+

0 commit comments

Comments
 (0)