Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 18 additions & 22 deletions .github/workflows/pg16-merge-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,8 @@ jobs:
# Uncomment and add tests as features become available
ALL_TESTS='{
"include": [
{"test":"ic-small-opt-off",
"make_configs":["src/test/regress:installcheck-small"],
"pg_settings":{"optimizer":"off"}
},
{"test":"ic-greenplum-schedule",
"make_configs":["src/test/regress:installcheck-cbdb"],
{"test":"ic-good-opt-off",
"make_configs":["src/test/regress:installcheck-good"],
"pg_settings":{"optimizer":"off"}
},
{"test":"ic-isolation2-basic",
Expand Down Expand Up @@ -298,7 +294,7 @@ jobs:
echo "- Install Prefix: ${INSTALL_PREFIX}"
echo "- Port: 5432"
echo "- Debug: Enabled (O0, g3, cassert)"
echo "- Disabled Features: ORCA, GPCloud, GPFdist, zstd"
echo "- Disabled Features: GPCloud"
} >> "$GITHUB_STEP_SUMMARY"

- name: Prepare Installation Directory
Expand Down Expand Up @@ -344,16 +340,16 @@ jobs:
echo " --enable-cassert"
echo " --enable-debug-extensions"
echo " --with-perl --with-python --with-libxml --with-openssl"
echo " --without-zstd"
echo " --disable-gpcloud --disable-orca --disable-gpfdist"
echo " --with-zstd"
echo " --disable-gpcloud"
echo " --with-pythonsrc-ext"
echo " --with-gssapi"
echo ""

# Run configure as gpadmin
if ! su - gpadmin -c "
cd ${SRC_DIR}
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:\${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}
CFLAGS='-O0 -g3' ./configure \
--prefix=${INSTALL_PREFIX} \
--with-pgport=5432 \
Expand All @@ -362,14 +358,14 @@ jobs:
--with-python \
--with-libxml \
--with-openssl \
--without-zstd \
--with-zstd \
--enable-debug-extensions \
--disable-gpcloud \
--disable-orca \
--disable-gpfdist \
--with-pythonsrc-ext \
--with-gssapi \
--without-icu
--without-icu \
--with-libraries=${INSTALL_PREFIX}/lib \
--with-includes=/usr/local/xerces-c/include
"; then
echo "::error::Configure failed"
exit 1
Expand All @@ -392,9 +388,9 @@ jobs:
# Build and install as gpadmin (non-parallel to avoid issues)
if ! time su - gpadmin -c "
cd ${SRC_DIR}
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:\${LD_LIBRARY_PATH}
make
make install
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}
make -j$(nproc)
make -j$(nproc) install
"; then
echo "::error::Build and installation failed"
exit 1
Expand Down Expand Up @@ -628,7 +624,7 @@ jobs:
# We don't need to build, just configure
su - gpadmin -c "
cd ${SRC_DIR}
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:\${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}
CFLAGS='-O0 -g3' ./configure \
--prefix=${INSTALL_PREFIX} \
--with-pgport=5432 \
Expand All @@ -637,14 +633,14 @@ jobs:
--with-python \
--with-libxml \
--with-openssl \
--without-zstd \
--with-zstd \
--enable-debug-extensions \
--disable-gpcloud \
--disable-orca \
--disable-gpfdist \
--with-pythonsrc-ext \
--with-gssapi \
--without-icu
--without-icu \
--with-libraries=${INSTALL_PREFIX}/lib \
--with-includes=/usr/local/xerces-c/include
" 2>&1 | tee -a ${LOGS_DIR}/details/configure.log

- name: Create gpdemo Cluster
Expand Down
7 changes: 6 additions & 1 deletion src/backend/utils/activity/pgstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,7 @@ assign_stats_fetch_consistency(int newval, void *extra)
void
pgstat_send_qd_tabstats(void)
{
int nest_level;
PgStat_SubXactStatus *xact_state;
StringInfoData buf;
PgStatTabRecordFromQE *records;
Expand All @@ -1788,10 +1789,14 @@ pgstat_send_qd_tabstats(void)
* current nesting level's per-table insert/update/delete counts.
*/
xact_state = pgstat_get_current_xact_stack();

if (xact_state == NULL)
return;

nest_level = GetCurrentTransactionNestLevel();

if (nest_level != xact_state->nest_level)
return;

records = (PgStatTabRecordFromQE *)
palloc(capacity * sizeof(PgStatTabRecordFromQE));

Expand Down
7 changes: 5 additions & 2 deletions src/bin/pg_basebackup/bbstreamer_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,15 @@ extract_directory(const char *filename, mode_t mode)
* pg_xlog we assume is deleted at the start of
* pg_basebackup. We cannot delete pg_xlog because if
* streammode was used then it may have already copied
* new xlog files into pg_xlog directory.
* new xlog files into pg_xlog directory. Similarly,
* archive_status may have .done files created by the
* WAL streamer child process via mark_file_as_archived().
*/
if (pg_str_endswith(filename, "/pg_log") ||
pg_str_endswith(filename, "/log") ||
pg_str_endswith(filename, "/pg_wal") ||
pg_str_endswith(filename, "/pg_xlog"))
pg_str_endswith(filename, "/pg_xlog") ||
pg_str_endswith(filename, "/archive_status"))
return;

rmtree(filename, true);
Expand Down
2 changes: 1 addition & 1 deletion src/test/isolation2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test_parallel_retrieve_cursor_extended_query_error: test_parallel_retrieve_curso
$(CC) $(CPPFLAGS) $(rpath) -I$(top_builddir)/src/interfaces/libpq -L$(GPHOME)/lib -L$(top_builddir)/src/interfaces/libpq -o $@ $< -lpq

pg_regress.o:
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress.o
$(MAKE) -C $(top_builddir)/src/test/regress install
rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/pg_regress.o .

gpstringsubs.pl:
Expand Down
2 changes: 1 addition & 1 deletion src/test/isolation2/expected/bitmap_index_crash.out
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ select count(*) from test_bitmap where type = 520;
(1 row)

-- start_ignore
! gpstop -rai;
! gpstop -raf;
-- end_ignore

0: select count(*) from test_bitmap where type = 520;
Expand Down
2 changes: 1 addition & 1 deletion src/test/isolation2/expected/gdd/end.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ALTER
-- Use utility session on seg 0 to restart master. This way avoids the
-- situation where session issuing the restart doesn't disappear
-- itself.
1U:SELECT pg_ctl(dir, 'restart') from datadir;
1U:SELECT pg_ctl(dir, 'restart', 'fast') from datadir;
pg_ctl
--------
OK
Expand Down
2 changes: 1 addition & 1 deletion src/test/isolation2/expected/gdd/prepare.out
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ ALTER
-- Use utility session on seg 0 to restart master. This way avoids the
-- situation where session issuing the restart doesn't disappear
-- itself.
1U:SELECT pg_ctl(dir, 'restart') from datadir;
1U:SELECT pg_ctl(dir, 'restart', 'fast') from datadir;
pg_ctl
--------
OK
Expand Down
2 changes: 1 addition & 1 deletion src/test/isolation2/expected/instr_in_shmem_setup.out
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
-- start_ignore
! gpconfig -c gp_enable_query_metrics -v on; ! gpstop -rai;
! gpconfig -c gp_enable_query_metrics -v on; ! gpstop -raf;
-- end_ignore
6 changes: 3 additions & 3 deletions src/test/isolation2/expected/pg_rewind_fail_missing_xlog.out
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ INSERT 3

-- end_ignore
(exited with code 0)
!\retcode gpstop -ari;
!\retcode gpstop -arf;
(exited with code 0)

-- Test 1: Ensure that pg_rewind doesn't fail due to checkpoints inadvertently
Expand Down Expand Up @@ -543,7 +543,7 @@ server closed the connection unexpectedly

-- end_ignore
(exited with code 0)
!\retcode gpstop -ari;
!\retcode gpstop -arf;
-- start_ignore
-- end_ignore
(exited with code 0)
Expand Down Expand Up @@ -663,7 +663,7 @@ DROP

-- end_ignore
(exited with code 0)
!\retcode gpstop -ari;
!\retcode gpstop -arf;
-- start_ignore
-- end_ignore
(exited with code 0)
4 changes: 2 additions & 2 deletions src/test/isolation2/expected/prepare_limit.out
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
-- Enable gp_autostats_mode to make sure the single value insert triger 2pc
!\retcode gpconfig -c gp_autostats_mode -v 'on_no_stats' --skipvalidation;
(exited with code 0)
!\retcode gpstop -ari;
!\retcode gpstop -arf;
(exited with code 0)

5: create table prepare_limit1 (a int);
Expand Down Expand Up @@ -119,5 +119,5 @@ DROP
(exited with code 0)
!\retcode gpconfig -c gp_autostats_mode -v 'none' --skipvalidation;
(exited with code 0)
!\retcode gpstop -ari;
!\retcode gpstop -arf;
(exited with code 0)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ERROR: language "plpython3u" already exists

! gpconfig -c runaway_detector_activation_percent -v 100;

! gpstop -rai;
! gpstop -raf;
-- end_ignore

-- after the restart we need a new connection to run the queries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ERROR: language "plpython3u" already exists

! gpconfig -c runaway_detector_activation_percent -v 100;

! gpstop -rai;
! gpstop -raf;
-- end_ignore

-- after the restart we need a new connection to run the queries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ALTER RESOURCE GROUP


-- start_ignore
! gpstop -rai;
! gpstop -raf;
-- end_ignore

-- Cleanup in a new connection as the default one is disconnected by gpstop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- start_ignore
! gpconfig -r gp_resource_manager;

! gpstop -rai;
! gpstop -ra;

SHOW gp_resource_manager;
gp_resource_manager
Expand Down
4 changes: 2 additions & 2 deletions src/test/isolation2/expected/resgroup/resgroup_syntax.out
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ DROP
-- start_ignore
-- end_ignore
(exited with code 0)
!\retcode gpstop -ari;
!\retcode gpstop -arf;
-- start_ignore
-- end_ignore
(exited with code 0)
Expand All @@ -579,7 +579,7 @@ DROP
-- start_ignore
-- end_ignore
(exited with code 0)
!\retcode gpstop -ari;
!\retcode gpstop -arf;
-- start_ignore
-- end_ignore
(exited with code 0)
Expand Down
4 changes: 2 additions & 2 deletions src/test/isolation2/init_file_isolation2
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ m/.*Process \d+ waits for ExclusiveLock on resource queue \d+; blocked by proces
s/.*Process \d+ waits for ExclusiveLock on resource queue \d+; blocked by process \d+./Process PID waits for ExclusiveLock on resource queue OID; blocked by process PID./

# For resource queue self-deadlock detail
m/resource queue id: \d+, portal id: \d+/
s/resource queue id: \d+, portal id: \d+/resource queue id: OID, portal id: NUM/
m/resource queue id: (\d+|XXXX), portal id: \d+/
s/resource queue id: (\d+|XXXX), portal id: \d+/resource queue id: OID, portal id: NUM/

m/^Process \d+ waits for ShareLock on transaction \d+; blocked by process \d+./
s/^Process \d+ waits for ShareLock on transaction \d+; blocked by process \d+./Process PID waits for ShareLock on transaction XID; blocked by process PID./
Expand Down
4 changes: 2 additions & 2 deletions src/test/isolation2/input/workfile_mgr_test.source
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ language plpgsql volatile execute on all segments;

-- start_ignore
!\retcode gpconfig -c gp_workfile_max_entries -v 32 --skipvalidation;
!\retcode gpstop -ari;
!\retcode gpstop -arf;
-- end_ignore

-- setup for workfile made in temp tablespace test
Expand All @@ -80,7 +80,7 @@ language plpgsql volatile execute on all segments;

-- start_ignore
!\retcode gpconfig -r gp_workfile_max_entries --skipvalidation;
!\retcode gpstop -ari;
!\retcode gpstop -arf;
-- end_ignore

-- test workset cleanup
Expand Down
4 changes: 2 additions & 2 deletions src/test/isolation2/output/workfile_mgr_test.source
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CREATE

-- end_ignore
(exited with code 0)
!\retcode gpstop -ari;
!\retcode gpstop -arf;
-- start_ignore
20200923:12:05:57:014232 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -ari
20200923:12:05:57:014232 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
Expand Down Expand Up @@ -132,7 +132,7 @@ DROP

-- end_ignore
(exited with code 0)
!\retcode gpstop -ari;
!\retcode gpstop -arf;
-- start_ignore
20200923:12:08:05:016154 gpstop:mdw:gpadmin-[INFO]:-Starting gpstop with args: -ari
20200923:12:08:05:016154 gpstop:mdw:gpadmin-[INFO]:-Gathering information and validating the environment...
Expand Down
2 changes: 1 addition & 1 deletion src/test/isolation2/sql/bitmap_index_crash.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ create index on test_bitmap using bitmap(type);
select count(*) from test_bitmap where type = 520;

-- start_ignore
! gpstop -rai;
! gpstop -raf;
-- end_ignore

0: select count(*) from test_bitmap where type = 520;
Expand Down
2 changes: 1 addition & 1 deletion src/test/isolation2/sql/gdd/end.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ALTER SYSTEM RESET gp_global_deadlock_detector_period;
-- Use utility session on seg 0 to restart master. This way avoids the
-- situation where session issuing the restart doesn't disappear
-- itself.
1U:SELECT pg_ctl(dir, 'restart') from datadir;
1U:SELECT pg_ctl(dir, 'restart', 'fast') from datadir;
-- Start new session on master to make sure it has fully completed
-- recovery and up and running again.
1: SHOW gp_enable_global_deadlock_detector;
Expand Down
2 changes: 1 addition & 1 deletion src/test/isolation2/sql/gdd/prepare.sql
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ALTER SYSTEM SET gp_global_deadlock_detector_period TO 5;
-- Use utility session on seg 0 to restart master. This way avoids the
-- situation where session issuing the restart doesn't disappear
-- itself.
1U:SELECT pg_ctl(dir, 'restart') from datadir;
1U:SELECT pg_ctl(dir, 'restart', 'fast') from datadir;
-- Start new session on master to make sure it has fully completed
-- recovery and up and running again.
1: SHOW gp_enable_global_deadlock_detector;
Expand Down
2 changes: 1 addition & 1 deletion src/test/isolation2/sql/instr_in_shmem_setup.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- start_ignore
! gpconfig -c gp_enable_query_metrics -v on;
! gpstop -rai;
! gpstop -raf;
-- end_ignore
6 changes: 3 additions & 3 deletions src/test/isolation2/sql/pg_rewind_fail_missing_xlog.sql
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ INSERT INTO tst_missing_tbl values(2),(1),(5);

-- Make the test faster by not preserving any extra wal segment files
!\retcode gpconfig -c wal_keep_size -v 0;
!\retcode gpstop -ari;
!\retcode gpstop -arf;

-- Test 1: Ensure that pg_rewind doesn't fail due to checkpoints inadvertently
-- recycling WAL when a former primary is marked down in configuration, while it
Expand Down Expand Up @@ -269,7 +269,7 @@ INSERT INTO tst_missing_tbl values(2),(1),(5);

-- Turn off wal_recycle to make this test easier to write.
!\retcode gpconfig -c wal_recycle -v false;
!\retcode gpstop -ari;
!\retcode gpstop -arf;

-- Create an unlogged table on the primary that remembers replication slot's last restart_lsn and number of WAL files.
1U: CREATE UNLOGGED TABLE unlogged_wal_retention_test(restart_lsn_before pg_lsn, wal_count_before int);
Expand Down Expand Up @@ -320,4 +320,4 @@ INSERT INTO tst_missing_tbl values(2),(1),(5);
5: DROP FUNCTION connectSeg;
!\retcode gpconfig -r wal_keep_size;
!\retcode gpconfig -r wal_recycle;
!\retcode gpstop -ari;
!\retcode gpstop -arf;
Loading
Loading