Skip to content

Commit 836dee2

Browse files
author
liushengsong
committed
Fix: fix test parallel_schedule, greenplum_schedule, isolation2_schdule
1 parent ec26821 commit 836dee2

45 files changed

Lines changed: 237 additions & 156 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/pg16-merge-validation.yml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,8 @@ jobs:
111111
# Uncomment and add tests as features become available
112112
ALL_TESTS='{
113113
"include": [
114-
{"test":"ic-small-opt-off",
115-
"make_configs":["src/test/regress:installcheck-small"],
116-
"pg_settings":{"optimizer":"off"}
117-
},
118-
{"test":"ic-greenplum-schedule",
119-
"make_configs":["src/test/regress:installcheck-cbdb"],
114+
{"test":"ic-good-opt-off",
115+
"make_configs":["src/test/regress:installcheck-good"],
120116
"pg_settings":{"optimizer":"off"}
121117
},
122118
{"test":"ic-isolation2-basic",
@@ -298,7 +294,7 @@ jobs:
298294
echo "- Install Prefix: ${INSTALL_PREFIX}"
299295
echo "- Port: 5432"
300296
echo "- Debug: Enabled (O0, g3, cassert)"
301-
echo "- Disabled Features: ORCA, GPCloud, GPFdist, zstd"
297+
echo "- Disabled Features: GPCloud"
302298
} >> "$GITHUB_STEP_SUMMARY"
303299
304300
- name: Prepare Installation Directory
@@ -344,16 +340,16 @@ jobs:
344340
echo " --enable-cassert"
345341
echo " --enable-debug-extensions"
346342
echo " --with-perl --with-python --with-libxml --with-openssl"
347-
echo " --without-zstd"
348-
echo " --disable-gpcloud --disable-orca --disable-gpfdist"
343+
echo " --with-zstd"
344+
echo " --disable-gpcloud"
349345
echo " --with-pythonsrc-ext"
350346
echo " --with-gssapi"
351347
echo ""
352348
353349
# Run configure as gpadmin
354350
if ! su - gpadmin -c "
355351
cd ${SRC_DIR}
356-
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:\${LD_LIBRARY_PATH}
352+
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}
357353
CFLAGS='-O0 -g3' ./configure \
358354
--prefix=${INSTALL_PREFIX} \
359355
--with-pgport=5432 \
@@ -362,14 +358,14 @@ jobs:
362358
--with-python \
363359
--with-libxml \
364360
--with-openssl \
365-
--without-zstd \
361+
--with-zstd \
366362
--enable-debug-extensions \
367363
--disable-gpcloud \
368-
--disable-orca \
369-
--disable-gpfdist \
370364
--with-pythonsrc-ext \
371365
--with-gssapi \
372-
--without-icu
366+
--without-icu \
367+
--with-libraries=${INSTALL_PREFIX}/lib \
368+
--with-includes=/usr/local/xerces-c/include
373369
"; then
374370
echo "::error::Configure failed"
375371
exit 1
@@ -392,9 +388,9 @@ jobs:
392388
# Build and install as gpadmin (non-parallel to avoid issues)
393389
if ! time su - gpadmin -c "
394390
cd ${SRC_DIR}
395-
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:\${LD_LIBRARY_PATH}
396-
make
397-
make install
391+
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}
392+
make -j$(nproc)
393+
make -j$(nproc) install
398394
"; then
399395
echo "::error::Build and installation failed"
400396
exit 1
@@ -628,7 +624,7 @@ jobs:
628624
# We don't need to build, just configure
629625
su - gpadmin -c "
630626
cd ${SRC_DIR}
631-
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:\${LD_LIBRARY_PATH}
627+
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH}
632628
CFLAGS='-O0 -g3' ./configure \
633629
--prefix=${INSTALL_PREFIX} \
634630
--with-pgport=5432 \
@@ -637,14 +633,14 @@ jobs:
637633
--with-python \
638634
--with-libxml \
639635
--with-openssl \
640-
--without-zstd \
636+
--with-zstd \
641637
--enable-debug-extensions \
642638
--disable-gpcloud \
643-
--disable-orca \
644-
--disable-gpfdist \
645639
--with-pythonsrc-ext \
646640
--with-gssapi \
647-
--without-icu
641+
--without-icu \
642+
--with-libraries=${INSTALL_PREFIX}/lib \
643+
--with-includes=/usr/local/xerces-c/include
648644
" 2>&1 | tee -a ${LOGS_DIR}/details/configure.log
649645
650646
- name: Create gpdemo Cluster

src/backend/utils/activity/pgstat.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1772,6 +1772,7 @@ assign_stats_fetch_consistency(int newval, void *extra)
17721772
void
17731773
pgstat_send_qd_tabstats(void)
17741774
{
1775+
int nest_level;
17751776
PgStat_SubXactStatus *xact_state;
17761777
StringInfoData buf;
17771778
PgStatTabRecordFromQE *records;
@@ -1788,10 +1789,14 @@ pgstat_send_qd_tabstats(void)
17881789
* current nesting level's per-table insert/update/delete counts.
17891790
*/
17901791
xact_state = pgstat_get_current_xact_stack();
1791-
17921792
if (xact_state == NULL)
17931793
return;
17941794

1795+
nest_level = GetCurrentTransactionNestLevel();
1796+
1797+
if (nest_level != xact_state->nest_level)
1798+
return;
1799+
17951800
records = (PgStatTabRecordFromQE *)
17961801
palloc(capacity * sizeof(PgStatTabRecordFromQE));
17971802

src/bin/pg_basebackup/bbstreamer_file.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,12 +323,15 @@ extract_directory(const char *filename, mode_t mode)
323323
* pg_xlog we assume is deleted at the start of
324324
* pg_basebackup. We cannot delete pg_xlog because if
325325
* streammode was used then it may have already copied
326-
* new xlog files into pg_xlog directory.
326+
* new xlog files into pg_xlog directory. Similarly,
327+
* archive_status may have .done files created by the
328+
* WAL streamer child process via mark_file_as_archived().
327329
*/
328330
if (pg_str_endswith(filename, "/pg_log") ||
329331
pg_str_endswith(filename, "/log") ||
330332
pg_str_endswith(filename, "/pg_wal") ||
331-
pg_str_endswith(filename, "/pg_xlog"))
333+
pg_str_endswith(filename, "/pg_xlog") ||
334+
pg_str_endswith(filename, "/archive_status"))
332335
return;
333336

334337
rmtree(filename, true);

src/test/isolation2/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test_parallel_retrieve_cursor_extended_query_error: test_parallel_retrieve_curso
2929
$(CC) $(CPPFLAGS) $(rpath) -I$(top_builddir)/src/interfaces/libpq -L$(GPHOME)/lib -L$(top_builddir)/src/interfaces/libpq -o $@ $< -lpq
3030

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

3535
gpstringsubs.pl:

src/test/isolation2/expected/bitmap_index_crash.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ select count(*) from test_bitmap where type = 520;
111111
(1 row)
112112

113113
-- start_ignore
114-
! gpstop -rai;
114+
! gpstop -raf;
115115
-- end_ignore
116116

117117
0: select count(*) from test_bitmap where type = 520;

src/test/isolation2/expected/gdd/end.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ALTER
66
-- Use utility session on seg 0 to restart master. This way avoids the
77
-- situation where session issuing the restart doesn't disappear
88
-- itself.
9-
1U:SELECT pg_ctl(dir, 'restart') from datadir;
9+
1U:SELECT pg_ctl(dir, 'restart', 'fast') from datadir;
1010
pg_ctl
1111
--------
1212
OK

src/test/isolation2/expected/gdd/prepare.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ ALTER
7575
-- Use utility session on seg 0 to restart master. This way avoids the
7676
-- situation where session issuing the restart doesn't disappear
7777
-- itself.
78-
1U:SELECT pg_ctl(dir, 'restart') from datadir;
78+
1U:SELECT pg_ctl(dir, 'restart', 'fast') from datadir;
7979
pg_ctl
8080
--------
8181
OK
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
-- start_ignore
2-
! gpconfig -c gp_enable_query_metrics -v on; ! gpstop -rai;
2+
! gpconfig -c gp_enable_query_metrics -v on; ! gpstop -raf;
33
-- end_ignore

src/test/isolation2/expected/pg_rewind_fail_missing_xlog.out

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ INSERT 3
1919

2020
-- end_ignore
2121
(exited with code 0)
22-
!\retcode gpstop -ari;
22+
!\retcode gpstop -arf;
2323
(exited with code 0)
2424

2525
-- Test 1: Ensure that pg_rewind doesn't fail due to checkpoints inadvertently
@@ -543,14 +543,40 @@ server closed the connection unexpectedly
543543

544544
-- end_ignore
545545
(exited with code 0)
546-
!\retcode gpstop -ari;
546+
!\retcode gpstop -arf;
547547
-- start_ignore
548548
-- end_ignore
549549
(exited with code 0)
550550

551551
-- Create an unlogged table on the primary that remembers replication slot's last restart_lsn and number of WAL files.
552552
1U: CREATE UNLOGGED TABLE unlogged_wal_retention_test(restart_lsn_before pg_lsn, wal_count_before int);
553553
CREATE
554+
-- Force WAL segment switches to ensure there are old WAL files that can be removed after checkpoint.
555+
1U: SELECT pg_switch_wal() IS NOT NULL;
556+
?column?
557+
----------
558+
t
559+
(1 row)
560+
1U: SELECT pg_switch_wal() IS NOT NULL;
561+
?column?
562+
----------
563+
t
564+
(1 row)
565+
1U: SELECT pg_switch_wal() IS NOT NULL;
566+
?column?
567+
----------
568+
t
569+
(1 row)
570+
1U: SELECT pg_switch_wal() IS NOT NULL;
571+
?column?
572+
----------
573+
t
574+
(1 row)
575+
1U: SELECT pg_switch_wal() IS NOT NULL;
576+
?column?
577+
----------
578+
t
579+
(1 row)
554580
1U: INSERT INTO unlogged_wal_retention_test SELECT (select restart_lsn FROM pg_replication_slots WHERE slot_name = 'internal_wal_replication_slot') as restart_lsn_before, (select count(*) from pg_ls_waldir()) as wal_count_before;
555581
INSERT 1
556582
5: CHECKPOINT;
@@ -663,7 +689,7 @@ DROP
663689

664690
-- end_ignore
665691
(exited with code 0)
666-
!\retcode gpstop -ari;
692+
!\retcode gpstop -arf;
667693
-- start_ignore
668694
-- end_ignore
669695
(exited with code 0)

src/test/isolation2/expected/prepare_limit.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
-- Enable gp_autostats_mode to make sure the single value insert triger 2pc
1515
!\retcode gpconfig -c gp_autostats_mode -v 'on_no_stats' --skipvalidation;
1616
(exited with code 0)
17-
!\retcode gpstop -ari;
17+
!\retcode gpstop -arf;
1818
(exited with code 0)
1919

2020
5: create table prepare_limit1 (a int);
@@ -119,5 +119,5 @@ DROP
119119
(exited with code 0)
120120
!\retcode gpconfig -c gp_autostats_mode -v 'none' --skipvalidation;
121121
(exited with code 0)
122-
!\retcode gpstop -ari;
122+
!\retcode gpstop -arf;
123123
(exited with code 0)

0 commit comments

Comments
 (0)