From 26de680b648c5c4f021d5d8999f69b15f52d5593 Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Thu, 28 Dec 2023 15:58:11 +0530 Subject: [PATCH 01/10] Unblock few more test cases --- test/JDBC/parallel_query_jdbc_schedule | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/test/JDBC/parallel_query_jdbc_schedule b/test/JDBC/parallel_query_jdbc_schedule index 5fbce47d36..eda3ad5858 100644 --- a/test/JDBC/parallel_query_jdbc_schedule +++ b/test/JDBC/parallel_query_jdbc_schedule @@ -35,24 +35,3 @@ ignore#!#babel_table_type # These test should not ger run in parallel query ignore#!#BABEL-1363 -# Taking too much time to complete. (TIME-OUT FAILURES) -ignore#!#BABEL-SP_TABLE_PRIVILIGES-vu-verify -ignore#!#BABEL-SP_COLUMNS_MANAGED-dep-vu-verify -ignore#!#BABEL-SP_TABLES -ignore#!#ISC-Domains-vu-verify -ignore#!#Test-sp_rename-vu-prepare -ignore#!#Test-sp_rename-vu-verify -ignore#!#Test-sp_rename-vu-cleanup -ignore#!#BABEL-3013 -ignore#!#BABEL-SP_COLUMN_PRIVILEGES -ignore#!#BABEL-SP_TABLE_PRIVILEGES -ignore#!#ISC-Columns-vu-verify -ignore#!#TestSimpleErrors -ignore#!#ISC-Views -ignore#!#TestSimpleErrorsWithXactAbort -ignore#!#BABEL-2513 -ignore#!#TestDatetime-numeric-representation-vu-prepare -ignore#!#TestDatetime-numeric-representation-vu-verify -ignore#!#four-part-names-vu-verify -ignore#!#sp_columns_100 -ignore#!#sys-has_perms_by_name-vu-verify From 914b10a076f9a4aa5c990562a0e0f00476d1d18a Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Fri, 29 Dec 2023 15:44:31 +0530 Subject: [PATCH 02/10] Unblock few more test cases --- test/JDBC/README.md | 5 +++-- test/JDBC/input/BABEL-SP_COLUMN_PRIVILEGES.mix | 1 + test/JDBC/input/errorHandling/TestSimpleErrors.sql | 1 + test/JDBC/input/sp_columns_100.sql | 1 + test/JDBC/jdbc_schedule | 5 ++++- test/JDBC/parallel_query_jdbc_schedule | 7 +++++++ test/JDBC/src/main/java/com/sqlsamples/batch_run.java | 10 +++++++++- 7 files changed, 26 insertions(+), 4 deletions(-) diff --git a/test/JDBC/README.md b/test/JDBC/README.md index 69ef41f32b..546898ef8a 100644 --- a/test/JDBC/README.md +++ b/test/JDBC/README.md @@ -405,11 +405,12 @@ After building the modified PostgreSQL engine and Babelfish extensions using the mvn test ``` 5. If the expected output is different when run in parallel query mode and in normal mode, one can add a different expected output specially for parallel query mode in `expected/parallel_query/` folder. Additionally, one needs to add `-- parallel_query_expected` flag in the corresponding input file. -6. Cleanup all the objects, users, roles and databases created while running the tests: +6. If you want to have different SLA timeout when test runs in parallel query mode then use `-- sla_for_parallel_query_enforced` flag in the corresponding input file. +7. Cleanup all the objects, users, roles and databases created while running the tests: ```bash ./cleanup.sh ``` -7. Please note that when you have completed testing with parallel query mode enabled, you should unset the `isParallelQueryMode` environment variable that was previously set to `true`. This ensures that all tests run in the normal Babelfish mode (without parallel query): +8. Please note that when you have completed testing with parallel query mode enabled, you should unset the `isParallelQueryMode` environment variable that was previously set to `true`. This ensures that all tests run in the normal Babelfish mode (without parallel query): ```bash unset isParallelQueryMode diff --git a/test/JDBC/input/BABEL-SP_COLUMN_PRIVILEGES.mix b/test/JDBC/input/BABEL-SP_COLUMN_PRIVILEGES.mix index d03354f012..26a3c005a9 100644 --- a/test/JDBC/input/BABEL-SP_COLUMN_PRIVILEGES.mix +++ b/test/JDBC/input/BABEL-SP_COLUMN_PRIVILEGES.mix @@ -1,4 +1,5 @@ -- sla 10000 +-- sla_for_parallel_query_enforced 15000 -- tsql CREATE DATABASE db1 GO diff --git a/test/JDBC/input/errorHandling/TestSimpleErrors.sql b/test/JDBC/input/errorHandling/TestSimpleErrors.sql index 95832cfe32..5781ad1d07 100644 --- a/test/JDBC/input/errorHandling/TestSimpleErrors.sql +++ b/test/JDBC/input/errorHandling/TestSimpleErrors.sql @@ -1,3 +1,4 @@ +-- sla_for_parallel_query_enforced 42000 CREATE TABLE simpleErrorTable (a varchar(15) UNIQUE NOT NULL, b nvarchar(25), c int PRIMARY KEY, d char(15) DEFAULT 'Whoops!', e nchar(25), f datetime, g numeric(4,1) CHECK (g >= 103.5)) GO diff --git a/test/JDBC/input/sp_columns_100.sql b/test/JDBC/input/sp_columns_100.sql index 0f222c21d3..a0e9e847e5 100644 --- a/test/JDBC/input/sp_columns_100.sql +++ b/test/JDBC/input/sp_columns_100.sql @@ -1,3 +1,4 @@ +-- sla_for_parallel_query_enforced 55000 -- create tables with most of the datatypes create table var(a char(10), b nchar(9), c nvarchar(8), d varchar(7), e text, f ntext, g varbinary(10), h binary(9), i image, j xml) go diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index 0be0c2ac3f..2a0a45c9f1 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -8,7 +8,10 @@ # new line # 6. If you want the framework to not run certain files, use: ignore#!# -all +#all +sys-has_perms_by_name-vu-prepare +sys-has_perms_by_name-vu-verify +sys-has_perms_by_name-vu-cleanup # BABEL-SP_FKEYS test is very slow and causing github action timeout. diff --git a/test/JDBC/parallel_query_jdbc_schedule b/test/JDBC/parallel_query_jdbc_schedule index eda3ad5858..d6e9d86400 100644 --- a/test/JDBC/parallel_query_jdbc_schedule +++ b/test/JDBC/parallel_query_jdbc_schedule @@ -35,3 +35,10 @@ ignore#!#babel_table_type # These test should not ger run in parallel query ignore#!#BABEL-1363 +# Taking too much time to complete. (TIME-OUT FAILURES) +ignore#!#BABEL-SP_TABLE_PRIVILIGES-vu-verify +ignore#!#BABEL-3013 +ignore#!#BABEL-SP_TABLE_PRIVILEGES +ignore#!#ISC-Columns-vu-verify +ignore#!#four-part-names-vu-verify +ignore#!#sys-has_perms_by_name-vu-verify \ No newline at end of file diff --git a/test/JDBC/src/main/java/com/sqlsamples/batch_run.java b/test/JDBC/src/main/java/com/sqlsamples/batch_run.java index 20406176ae..6603495c4d 100644 --- a/test/JDBC/src/main/java/com/sqlsamples/batch_run.java +++ b/test/JDBC/src/main/java/com/sqlsamples/batch_run.java @@ -24,6 +24,7 @@ static void batch_run_sql(Connection con_bbl, BufferedWriter bw, String testFile boolean tsqlDialect = false; boolean psqlDialect = false; boolean customSLA = false; + boolean customSLAWithParallelQueryEnforced = false; if (testFilePath.contains(".mix")) { isCrossDialectFile = true; @@ -273,7 +274,14 @@ static void batch_run_sql(Connection con_bbl, BufferedWriter bw, String testFile } } else { customSLA = strLine.toLowerCase().startsWith("-- sla"); - if (customSLA){ + if (!customSLAWithParallelQueryEnforced && customSLA){ + String[] tokens=strLine.split(" "); + sla = Long.parseLong(tokens[2]); + sla = sla*(1000000L); + continue; + } + customSLAWithParallelQueryEnforced = isParallelQueryMode && strLine.toLowerCase().startsWith("-- sla_for_parallel_query_enforced"); + if (customSLAWithParallelQueryEnforced){ String[] tokens=strLine.split(" "); sla = Long.parseLong(tokens[2]); sla = sla*(1000000L); From ea175a1675aa0ca6896d7a57fc7c068077725ca7 Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Fri, 29 Dec 2023 17:01:16 +0530 Subject: [PATCH 03/10] update schedule file --- test/JDBC/jdbc_schedule | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index 2a0a45c9f1..0be0c2ac3f 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -8,10 +8,7 @@ # new line # 6. If you want the framework to not run certain files, use: ignore#!# -#all -sys-has_perms_by_name-vu-prepare -sys-has_perms_by_name-vu-verify -sys-has_perms_by_name-vu-cleanup +all # BABEL-SP_FKEYS test is very slow and causing github action timeout. From 91472f55ea37c9f9eb858d6b8f6dd511812fdc5a Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Tue, 2 Jan 2024 13:54:48 +0530 Subject: [PATCH 04/10] Ignore one more test case due to timeout --- test/JDBC/parallel_query_jdbc_schedule | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/JDBC/parallel_query_jdbc_schedule b/test/JDBC/parallel_query_jdbc_schedule index d6e9d86400..f508058d2b 100644 --- a/test/JDBC/parallel_query_jdbc_schedule +++ b/test/JDBC/parallel_query_jdbc_schedule @@ -41,4 +41,5 @@ ignore#!#BABEL-3013 ignore#!#BABEL-SP_TABLE_PRIVILEGES ignore#!#ISC-Columns-vu-verify ignore#!#four-part-names-vu-verify -ignore#!#sys-has_perms_by_name-vu-verify \ No newline at end of file +ignore#!#sys-has_perms_by_name-vu-verify +ignore#!#TestSimpleErrorsWithImplicitTran \ No newline at end of file From fab541fffd4c1d72fc330c7063a3fde9218d7247 Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Tue, 2 Jan 2024 15:18:53 +0530 Subject: [PATCH 05/10] Test one change --- .github/scripts/create_extension.sql | 2 ++ test/JDBC/init.sh | 2 ++ test/JDBC/jdbc_schedule | 5 ++++- test/JDBC/parallel_query_jdbc_schedule | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/scripts/create_extension.sql b/.github/scripts/create_extension.sql index 2b8c18449e..a767b8d916 100644 --- a/.github/scripts/create_extension.sql +++ b/.github/scripts/create_extension.sql @@ -15,6 +15,8 @@ ALTER SYSTEM SET babelfishpg_tsql.migration_mode = :'migration_mode'; ALTER SYSTEM SET min_parallel_index_scan_size = 0; ALTER SYSTEM SET min_parallel_table_scan_size = 0; ALTER SYSTEM SET force_parallel_mode = 1; + ALTER SYSTEM SET max_worker_processes = 20; + ALTER SYSTEM SET max_parallel_workers = 20; ALTER SYSTEM SET max_parallel_workers_per_gather = 4; \endif diff --git a/test/JDBC/init.sh b/test/JDBC/init.sh index 89d65574cc..1dc92def5a 100755 --- a/test/JDBC/init.sh +++ b/test/JDBC/init.sh @@ -57,6 +57,8 @@ ALTER SYSTEM SET min_parallel_index_scan_size = 0; ALTER SYSTEM SET min_parallel_table_scan_size = 0; ALTER SYSTEM SET force_parallel_mode = 1; ALTER SYSTEM SET max_parallel_workers_per_gather = 4; +ALTER SYSTEM SET max_worker_processes = 20; +ALTER SYSTEM SET max_parallel_workers = 20; SELECT pg_reload_conf(); \c jdbc_testdb show babelfishpg_tsql.database_name; diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index 0be0c2ac3f..31c8a02eb9 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -8,7 +8,10 @@ # new line # 6. If you want the framework to not run certain files, use: ignore#!# -all +#all +BABEL-SP_TABLE_PRIVILIGES-vu-prepare +BABEL-SP_TABLE_PRIVILIGES-vu-verify +BABEL-SP_TABLE_PRIVILIGES-vu-cleanup # BABEL-SP_FKEYS test is very slow and causing github action timeout. diff --git a/test/JDBC/parallel_query_jdbc_schedule b/test/JDBC/parallel_query_jdbc_schedule index f508058d2b..98ae249be7 100644 --- a/test/JDBC/parallel_query_jdbc_schedule +++ b/test/JDBC/parallel_query_jdbc_schedule @@ -36,7 +36,7 @@ ignore#!#babel_table_type ignore#!#BABEL-1363 # Taking too much time to complete. (TIME-OUT FAILURES) -ignore#!#BABEL-SP_TABLE_PRIVILIGES-vu-verify +#ignore#!#BABEL-SP_TABLE_PRIVILIGES-vu-verify ignore#!#BABEL-3013 ignore#!#BABEL-SP_TABLE_PRIVILEGES ignore#!#ISC-Columns-vu-verify From 709d2ff61fffff6557d785187284fb04b061ac52 Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Tue, 2 Jan 2024 19:07:02 +0530 Subject: [PATCH 06/10] Revert "Test one change" This reverts commit fab541fffd4c1d72fc330c7063a3fde9218d7247. --- .github/scripts/create_extension.sql | 2 -- test/JDBC/init.sh | 2 -- test/JDBC/jdbc_schedule | 5 +---- test/JDBC/parallel_query_jdbc_schedule | 2 +- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/scripts/create_extension.sql b/.github/scripts/create_extension.sql index a767b8d916..2b8c18449e 100644 --- a/.github/scripts/create_extension.sql +++ b/.github/scripts/create_extension.sql @@ -15,8 +15,6 @@ ALTER SYSTEM SET babelfishpg_tsql.migration_mode = :'migration_mode'; ALTER SYSTEM SET min_parallel_index_scan_size = 0; ALTER SYSTEM SET min_parallel_table_scan_size = 0; ALTER SYSTEM SET force_parallel_mode = 1; - ALTER SYSTEM SET max_worker_processes = 20; - ALTER SYSTEM SET max_parallel_workers = 20; ALTER SYSTEM SET max_parallel_workers_per_gather = 4; \endif diff --git a/test/JDBC/init.sh b/test/JDBC/init.sh index 1dc92def5a..89d65574cc 100755 --- a/test/JDBC/init.sh +++ b/test/JDBC/init.sh @@ -57,8 +57,6 @@ ALTER SYSTEM SET min_parallel_index_scan_size = 0; ALTER SYSTEM SET min_parallel_table_scan_size = 0; ALTER SYSTEM SET force_parallel_mode = 1; ALTER SYSTEM SET max_parallel_workers_per_gather = 4; -ALTER SYSTEM SET max_worker_processes = 20; -ALTER SYSTEM SET max_parallel_workers = 20; SELECT pg_reload_conf(); \c jdbc_testdb show babelfishpg_tsql.database_name; diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index 31c8a02eb9..0be0c2ac3f 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -8,10 +8,7 @@ # new line # 6. If you want the framework to not run certain files, use: ignore#!# -#all -BABEL-SP_TABLE_PRIVILIGES-vu-prepare -BABEL-SP_TABLE_PRIVILIGES-vu-verify -BABEL-SP_TABLE_PRIVILIGES-vu-cleanup +all # BABEL-SP_FKEYS test is very slow and causing github action timeout. diff --git a/test/JDBC/parallel_query_jdbc_schedule b/test/JDBC/parallel_query_jdbc_schedule index 98ae249be7..f508058d2b 100644 --- a/test/JDBC/parallel_query_jdbc_schedule +++ b/test/JDBC/parallel_query_jdbc_schedule @@ -36,7 +36,7 @@ ignore#!#babel_table_type ignore#!#BABEL-1363 # Taking too much time to complete. (TIME-OUT FAILURES) -#ignore#!#BABEL-SP_TABLE_PRIVILIGES-vu-verify +ignore#!#BABEL-SP_TABLE_PRIVILIGES-vu-verify ignore#!#BABEL-3013 ignore#!#BABEL-SP_TABLE_PRIVILEGES ignore#!#ISC-Columns-vu-verify From bd31e5986b31a9954e252e86a22f7954bfe2db34 Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Wed, 3 Jan 2024 14:55:19 +0530 Subject: [PATCH 07/10] Unblock few tests --- test/JDBC/input/errorHandling/TestSimpleErrors.sql | 2 +- test/JDBC/parallel_query_jdbc_schedule | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/test/JDBC/input/errorHandling/TestSimpleErrors.sql b/test/JDBC/input/errorHandling/TestSimpleErrors.sql index 5781ad1d07..8d103d4f0e 100644 --- a/test/JDBC/input/errorHandling/TestSimpleErrors.sql +++ b/test/JDBC/input/errorHandling/TestSimpleErrors.sql @@ -1,4 +1,4 @@ --- sla_for_parallel_query_enforced 42000 +-- sla_for_parallel_query_enforced 100000 CREATE TABLE simpleErrorTable (a varchar(15) UNIQUE NOT NULL, b nvarchar(25), c int PRIMARY KEY, d char(15) DEFAULT 'Whoops!', e nchar(25), f datetime, g numeric(4,1) CHECK (g >= 103.5)) GO diff --git a/test/JDBC/parallel_query_jdbc_schedule b/test/JDBC/parallel_query_jdbc_schedule index f508058d2b..53229dcbda 100644 --- a/test/JDBC/parallel_query_jdbc_schedule +++ b/test/JDBC/parallel_query_jdbc_schedule @@ -42,4 +42,3 @@ ignore#!#BABEL-SP_TABLE_PRIVILEGES ignore#!#ISC-Columns-vu-verify ignore#!#four-part-names-vu-verify ignore#!#sys-has_perms_by_name-vu-verify -ignore#!#TestSimpleErrorsWithImplicitTran \ No newline at end of file From 5193aa8dcdb8c6d9d06198c4330bd7d1562c640e Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Wed, 3 Jan 2024 17:15:43 +0530 Subject: [PATCH 08/10] Test one more testing --- test/JDBC/jdbc_schedule | 5 ++++- test/JDBC/parallel_query_jdbc_schedule | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index 0be0c2ac3f..2a0a45c9f1 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -8,7 +8,10 @@ # new line # 6. If you want the framework to not run certain files, use: ignore#!# -all +#all +sys-has_perms_by_name-vu-prepare +sys-has_perms_by_name-vu-verify +sys-has_perms_by_name-vu-cleanup # BABEL-SP_FKEYS test is very slow and causing github action timeout. diff --git a/test/JDBC/parallel_query_jdbc_schedule b/test/JDBC/parallel_query_jdbc_schedule index 53229dcbda..d0f3b6f63c 100644 --- a/test/JDBC/parallel_query_jdbc_schedule +++ b/test/JDBC/parallel_query_jdbc_schedule @@ -41,4 +41,4 @@ ignore#!#BABEL-3013 ignore#!#BABEL-SP_TABLE_PRIVILEGES ignore#!#ISC-Columns-vu-verify ignore#!#four-part-names-vu-verify -ignore#!#sys-has_perms_by_name-vu-verify +#ignore#!#sys-has_perms_by_name-vu-verify From 116d6ea9a05536f5f4f8729cc21c17930a29e63d Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Wed, 3 Jan 2024 17:27:07 +0530 Subject: [PATCH 09/10] Update sla --- test/JDBC/input/functions/sys-has_perms_by_name-vu-verify.mix | 1 + 1 file changed, 1 insertion(+) diff --git a/test/JDBC/input/functions/sys-has_perms_by_name-vu-verify.mix b/test/JDBC/input/functions/sys-has_perms_by_name-vu-verify.mix index 46dfb6b743..288b7ac3e3 100644 --- a/test/JDBC/input/functions/sys-has_perms_by_name-vu-verify.mix +++ b/test/JDBC/input/functions/sys-has_perms_by_name-vu-verify.mix @@ -1,3 +1,4 @@ +-- sla_for_parallel_query_enforced 70000 -- tsql -- reset the login password ALTER LOGIN user_perms_by_name WITH PASSWORD='test'; From 25b7bc2caf9a00707566c5d7c321d4b81b5776f5 Mon Sep 17 00:00:00 2001 From: Dipesh Dhameliya Date: Wed, 3 Jan 2024 19:39:04 +0530 Subject: [PATCH 10/10] Fix typo --- test/JDBC/jdbc_schedule | 5 +---- test/JDBC/parallel_query_jdbc_schedule | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test/JDBC/jdbc_schedule b/test/JDBC/jdbc_schedule index 2a0a45c9f1..0be0c2ac3f 100644 --- a/test/JDBC/jdbc_schedule +++ b/test/JDBC/jdbc_schedule @@ -8,10 +8,7 @@ # new line # 6. If you want the framework to not run certain files, use: ignore#!# -#all -sys-has_perms_by_name-vu-prepare -sys-has_perms_by_name-vu-verify -sys-has_perms_by_name-vu-cleanup +all # BABEL-SP_FKEYS test is very slow and causing github action timeout. diff --git a/test/JDBC/parallel_query_jdbc_schedule b/test/JDBC/parallel_query_jdbc_schedule index d0f3b6f63c..b724627fbc 100644 --- a/test/JDBC/parallel_query_jdbc_schedule +++ b/test/JDBC/parallel_query_jdbc_schedule @@ -32,7 +32,7 @@ ignore#!#Test-sp_addrolemember-dep-vu-verify ignore#!#Test-sp_droprolemember-dep-vu-verify ignore#!#babel_table_type -# These test should not ger run in parallel query +# These test should not get ran in parallel query ignore#!#BABEL-1363 # Taking too much time to complete. (TIME-OUT FAILURES)