Skip to content

Commit

Permalink
Fix failed cases by gp_appendonly_insert_files.
Browse files Browse the repository at this point in the history
We have changed gp_appendonly_insert_files to 4 by default.
It will cause lots of cases fail in cases related to AO/AOCS
segfile and etc.

As we enable insert multiple files regardless of enable_parallel,
the problems come up.

Use gpconfig to set GUCs before test cases to disable insert
multiple files and etc.

Authored-by: Zhang Mingli avamingli@gmail.com
  • Loading branch information
avamingli committed Jul 31, 2023
1 parent c4adec7 commit 320bc30
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/backend/utils/misc/guc_gp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3177,7 +3177,7 @@ struct config_int ConfigureNamesInt_gp[] =
NULL
},
&gp_appendonly_insert_files,
4, 0, 127,
4 /* CBDB_PARALLEL If default value is changed, set it in src/test/regress/GNUMakefile too, see details there */, 0, 127,
NULL, NULL, NULL
},

Expand Down
10 changes: 8 additions & 2 deletions src/test/isolation2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ clean distclean:
install: all gpdiff.pl gpstringsubs.pl

installcheck: install installcheck-parallel-retrieve-cursor
$(pg_isolation2_regress_installcheck) --init-file=$(top_builddir)/src/test/regress/init_file --init-file=./init_file_isolation2 --schedule=$(srcdir)/isolation2_schedule
(\
gpconfig -c gp_appendonly_insert_files -v 0; \
gpstop -u; \
$(pg_isolation2_regress_installcheck) --init-file=$(top_builddir)/src/test/regress/init_file --init-file=./init_file_isolation2 --schedule=$(srcdir)/isolation2_schedule \
)

installcheck-resgroup: install
$(pg_isolation2_regress_installcheck) --init-file=$(top_builddir)/src/test/regress/init_file --init-file=./init_file_resgroup --dbname=isolation2resgrouptest --schedule=$(srcdir)/isolation2_resgroup_schedule
Expand All @@ -74,6 +78,8 @@ installcheck-parallel-retrieve-cursor: install
# Add a new rule for running installcheck with parallel mode enabled.
installcheck-cbdb-parallel: install
(\
export PGOPTIONS='-c optimizer=off -c enable_parallel=true -c gp_appendonly_insert_files=0'; \
gpconfig -c gp_appendonly_insert_files -v 0; \
gpstop -u; \
export PGOPTIONS='-c optimizer=off -c enable_parallel=true'; \
$(pg_isolation2_regress_installcheck) --init-file=$(top_builddir)/src/test/regress/init_file --init-file=./init_file_isolation2 --schedule=$(srcdir)/isolation2_schedule \
)
12 changes: 11 additions & 1 deletion src/test/regress/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,18 @@ installcheck: installcheck-good
installcheck-small: all
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(EXTRA_TESTS)

# We have set default gp_appendonly_insert_files = 4 for user's underlying parallelism.
# But that will cause lots of diffs between non-parallel and parallel mode that we can't
# afford to modify them one by one, or create lots of answer files(and we didn't support that yet).
# Any tests related to ao parallel should set GUCs in their own sql files, like gp_parallel.
# Using gpconfig is a workaround for regression test for non-parallel and parallel mode.
# Same for src/test/isolation2/Makefile
installcheck-good: all twophase_pqexecparams hooktest query_info_hook_test
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule --schedule=$(srcdir)/greenplum_schedule $(EXTRA_TESTS)
(\
gpconfig -c gp_appendonly_insert_files -v 0; \
gpstop -u; \
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule --schedule=$(srcdir)/greenplum_schedule $(EXTRA_TESTS) \
)

installcheck-parallel: all
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS)
Expand Down
3 changes: 3 additions & 0 deletions src/test/regress/expected/gp_parallel.out
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ set force_parallel_mode = 0;
set optimizer = off;
create schema test_parallel;
set search_path to test_parallel;
-- set this to default in case regress change it by gpstop.
set gp_appendonly_insert_files = 4;
create table ao1(x int, y int) with(appendonly=true);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'x' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
Expand Down Expand Up @@ -1702,5 +1704,6 @@ abort;
-- start_ignore
drop schema test_parallel cascade;
-- end_ignore
reset gp_appendonly_insert_files;
reset force_parallel_mode;
reset optimizer;
3 changes: 3 additions & 0 deletions src/test/regress/sql/gp_parallel.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ set optimizer = off;

create schema test_parallel;
set search_path to test_parallel;
-- set this to default in case regress change it by gpstop.
set gp_appendonly_insert_files = 4;

create table ao1(x int, y int) with(appendonly=true);
create table ao2(x int, y int) with(appendonly=true);
Expand Down Expand Up @@ -512,5 +514,6 @@ abort;
drop schema test_parallel cascade;
-- end_ignore

reset gp_appendonly_insert_files;
reset force_parallel_mode;
reset optimizer;

0 comments on commit 320bc30

Please sign in to comment.