Skip to content

Commit 62c788c

Browse files
author
liushengsong
committed
fix greenplumn schedule
1 parent 7bff980 commit 62c788c

11 files changed

Lines changed: 87 additions & 65 deletions

File tree

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/test/regress/expected/autostats.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ set role=autostats_nonowner;
4545
LOG: statement: set role=autostats_nonowner;
4646
insert into autostats_test select generate_series(1, 10);
4747
LOG: statement: insert into autostats_test select generate_series(1, 10);
48-
LOG: An exception was encountered during the execution of statement: insert into autostats_test select generate_series(1, 10);
4948
ERROR: permission denied for table autostats_test
49+
LOG: An exception was encountered during the execution of statement: insert into autostats_test select generate_series(1, 10);
5050
select relname, reltuples from pg_class where relname='autostats_test';
5151
LOG: statement: select relname, reltuples from pg_class where relname='autostats_test';
5252
relname | reltuples
@@ -87,8 +87,8 @@ LOG: statement: select relname, reltuples from pg_class where relname='autostat
8787
-- Try to disable allow_nonowner GUC as ordinary user, should fail
8888
set gp_autostats_allow_nonowner=off;
8989
LOG: statement: set gp_autostats_allow_nonowner=off;
90-
LOG: An exception was encountered during the execution of statement: set gp_autostats_allow_nonowner=off;
9190
ERROR: permission denied to set parameter "gp_autostats_allow_nonowner"
91+
LOG: An exception was encountered during the execution of statement: set gp_autostats_allow_nonowner=off;
9292
show gp_autostats_allow_nonowner;
9393
LOG: statement: show gp_autostats_allow_nonowner;
9494
gp_autostats_allow_nonowner

src/test/regress/expected/explain.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ select jsonb_pretty(
759759
"Settings": { +
760760
"jit": "off", +
761761
"Optimizer": "Postgres query optimizer", +
762+
"optimizer": "off", +
762763
"enable_parallel": "off", +
763764
"parallel_setup_cost": "0", +
764765
"parallel_tuple_cost": "0", +

src/test/regress/expected/external_table.out

Lines changed: 45 additions & 41 deletions
Large diffs are not rendered by default.

src/test/regress/expected/gp_tablespace.out

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
-- start_matchsubs
2+
-- m|/.*/testtablespace_existing_version_dir/|
3+
-- s|/.*/testtablespace_existing_version_dir/|/ABSPATH/testtablespace_existing_version_dir/|
4+
-- end_matchsubs
15
-- start_matchignore
26
-- m/WARNING: tablespace symlink path is too long for TAR/
37
-- m/DETAIL: The symlinked path \".*\" will be truncated to 100 characters when sending a TAR to the utilities \(e.g. pg_basebackup\)/
@@ -416,28 +420,28 @@ SELECT force_mirrors_to_catch_up();
416420
(1 row)
417421

418422
\! ls $PG_ABS_SRCDIR/testtablespace_existing_version_dir/*
419-
/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/1:
423+
/ABSPATH/testtablespace_existing_version_dir/1:
420424
GPDB_99_399999991
421425

422-
/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/2:
426+
/ABSPATH/testtablespace_existing_version_dir/2:
423427
GPDB_99_399999991
424428

425-
/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/3:
429+
/ABSPATH/testtablespace_existing_version_dir/3:
426430
GPDB_99_399999991
427431

428-
/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/4:
432+
/ABSPATH/testtablespace_existing_version_dir/4:
429433
GPDB_99_399999991
430434

431-
/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/5:
435+
/ABSPATH/testtablespace_existing_version_dir/5:
432436
GPDB_99_399999991
433437

434-
/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/6:
438+
/ABSPATH/testtablespace_existing_version_dir/6:
435439
GPDB_99_399999991
436440

437-
/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/7:
441+
/ABSPATH/testtablespace_existing_version_dir/7:
438442
GPDB_99_399999991
439443

440-
/home/gpadmin/cloudberry/src/test/regress/testtablespace_existing_version_dir/8:
444+
/ABSPATH/testtablespace_existing_version_dir/8:
441445
GPDB_99_399999991
442446
-- Test alter tablespace: PG does not seem to test these.
443447
-- test SET & OWNER

src/test/regress/expected/profile.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
SELECT COUNT(*) FROM pg_stat_activity;
66
count
77
-------
8-
10
8+
9
99
(1 row)
1010

1111
-- Display pg_authid, pg_roles, pg_profile and pg_password_history catalog

src/test/regress/expected/stats.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ INSERT INTO drop_stats_test_xact DEFAULT VALUES;
413413
SELECT n_tup_ins FROM gp_stat_xact_all_tables_summary where relid = :drop_stats_test_xact_oid;
414414
n_tup_ins
415415
-----------
416-
1
416+
2
417417
(1 row)
418418

419419
DROP TABLE drop_stats_test_xact;
@@ -459,7 +459,7 @@ INSERT INTO drop_stats_test_xact DEFAULT VALUES;
459459
SELECT n_tup_ins FROM gp_stat_xact_all_tables_summary where relid = :drop_stats_test_xact_oid;
460460
n_tup_ins
461461
-----------
462-
1
462+
2
463463
(1 row)
464464

465465
DROP TABLE drop_stats_test_xact;
@@ -499,7 +499,7 @@ INSERT INTO drop_stats_test_subxact DEFAULT VALUES;
499499
SELECT n_tup_ins FROM gp_stat_xact_all_tables_summary where relid = :drop_stats_test_subxact_oid;
500500
n_tup_ins
501501
-----------
502-
2
502+
4
503503
(1 row)
504504

505505
SAVEPOINT sp2;
@@ -508,7 +508,7 @@ ROLLBACK TO SAVEPOINT sp2;
508508
SELECT n_tup_ins FROM gp_stat_xact_all_tables_summary where relid = :drop_stats_test_subxact_oid;
509509
n_tup_ins
510510
-----------
511-
2
511+
4
512512
(1 row)
513513

514514
COMMIT;

src/test/regress/input/uao_dml/uao_dml.source

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ select reltuples from pg_class where relname = 'ao2_@amname@';
7070
select count(*) from ao2_@amname@;
7171
delete from ao2_@amname@ where i < 27;
7272
-- make sure the pgstat msg sends out at least PGSTAT_STAT_INTERVAL msec since last one
73-
select pg_sleep(0.6);
73+
SELECT gp_stat_force_next_flush();
7474
analyze ao2_@amname@;
7575
select count(*) from ao2_@amname@;
7676
-- make sure the pgstat msg sends out at least PGSTAT_STAT_INTERVAL msec since last one
77-
select pg_sleep(0.6);
77+
SELECT gp_stat_force_next_flush();
7878
select pg_stat_get_live_tuples(c.oid) as livetuples, pg_stat_get_dead_tuples(c.oid) as deadtuples
7979
from pg_class c
8080
where relname = 'ao2_@amname@';

src/test/regress/output/uao_dml/uao_dml.source

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ select count(*) from ao2_@amname@;
147147

148148
delete from ao2_@amname@ where i < 27;
149149
-- make sure the pgstat msg sends out at least PGSTAT_STAT_INTERVAL msec since last one
150-
select pg_sleep(0.6);
151-
pg_sleep
152-
----------
150+
SELECT gp_stat_force_next_flush();
151+
gp_stat_force_next_flush
152+
--------------------------
153153

154154
(1 row)
155155

@@ -161,9 +161,9 @@ select count(*) from ao2_@amname@;
161161
(1 row)
162162

163163
-- make sure the pgstat msg sends out at least PGSTAT_STAT_INTERVAL msec since last one
164-
select pg_sleep(0.6);
165-
pg_sleep
166-
----------
164+
SELECT gp_stat_force_next_flush();
165+
gp_stat_force_next_flush
166+
--------------------------
167167

168168
(1 row)
169169

src/test/regress/sql/external_table.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
-- m/DETAIL: Found \d+ URLs and \d+ primary segments./
2424
-- s/Found.+//
2525
--
26+
-- # normalize absolute source paths across environments (also handles file:// URIs)
27+
-- m|/.+/src/test/regress/|
28+
-- s|/.+/src/test/regress/|/ABSPATH/src/test/regress/|
29+
--
2630
-- end_matchsubs
2731
\getenv abs_srcdir PG_ABS_SRCDIR
2832
\getenv hostname PG_HOSTNAME

0 commit comments

Comments
 (0)