From bcdfa5f2e2f274caeed20b2f986012a9cb6a259c Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 28 Feb 2024 09:39:52 +0100 Subject: [PATCH] Rename SLRU elements in view pg_stat_slru The new names are intended to match those in an upcoming patch that adds a few GUCs to configure the SLRU buffer sizes. Backwards compatibility concern: this changes the accepted names for function pg_stat_slru_rest(). Since this function recognizes "any other string" as a request to reset the entry for "other", this means that calling it with the old names would silently reset "other" instead of doing nothing or throwing an error. Reviewed-by: Andrey M. Borodin Discussion: https://postgr.es/m/202402261616.dlriae7b6emv@alvherre.pgsql --- doc/src/sgml/monitoring.sgml | 14 ++++---- src/backend/access/transam/clog.c | 2 +- src/backend/access/transam/commit_ts.c | 2 +- src/backend/access/transam/multixact.c | 4 +-- src/backend/access/transam/subtrans.c | 2 +- src/backend/commands/async.c | 2 +- src/backend/storage/lmgr/predicate.c | 2 +- src/include/utils/pgstat_internal.h | 14 ++++---- src/test/isolation/expected/stats.out | 44 ++++++++++++------------- src/test/isolation/expected/stats_1.out | 44 ++++++++++++------------- src/test/isolation/specs/stats.spec | 4 +-- src/test/regress/expected/stats.out | 14 ++++---- src/test/regress/sql/stats.sql | 14 ++++---- 13 files changed, 81 insertions(+), 81 deletions(-) diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 5cf9363ac8..9d73d8c1bb 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -4853,13 +4853,13 @@ description | Waiting for a newly initialized WAL file to reach durable storage NULL or is not specified, all the counters shown in the pg_stat_slru view for all SLRU caches are reset. The argument can be one of - CommitTs, - MultiXactMember, - MultiXactOffset, - Notify, - Serial, - Subtrans, or - Xact + commit_timestamp, + multixact_member, + multixact_offset, + notify, + serializable, + subtransaction, or + transaction to reset the counters for only that entry. If the argument is other (or indeed, any unrecognized name), then the counters for all other SLRU caches, such diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c index 97f7434da3..34f079cbb1 100644 --- a/src/backend/access/transam/clog.c +++ b/src/backend/access/transam/clog.c @@ -706,7 +706,7 @@ void CLOGShmemInit(void) { XactCtl->PagePrecedes = CLOGPagePrecedes; - SimpleLruInit(XactCtl, "Xact", CLOGShmemBuffers(), CLOG_LSNS_PER_PAGE, + SimpleLruInit(XactCtl, "transaction", CLOGShmemBuffers(), CLOG_LSNS_PER_PAGE, XactSLRULock, "pg_xact", LWTRANCHE_XACT_BUFFER, SYNC_HANDLER_CLOG, false); SlruPagePrecedesUnitTests(XactCtl, CLOG_XACTS_PER_PAGE); diff --git a/src/backend/access/transam/commit_ts.c b/src/backend/access/transam/commit_ts.c index 6bfe60343e..d965db89c7 100644 --- a/src/backend/access/transam/commit_ts.c +++ b/src/backend/access/transam/commit_ts.c @@ -529,7 +529,7 @@ CommitTsShmemInit(void) bool found; CommitTsCtl->PagePrecedes = CommitTsPagePrecedes; - SimpleLruInit(CommitTsCtl, "CommitTs", CommitTsShmemBuffers(), 0, + SimpleLruInit(CommitTsCtl, "commit_timestamp", CommitTsShmemBuffers(), 0, CommitTsSLRULock, "pg_commit_ts", LWTRANCHE_COMMITTS_BUFFER, SYNC_HANDLER_COMMIT_TS, diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c index febc429f72..64040d330e 100644 --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -1851,14 +1851,14 @@ MultiXactShmemInit(void) MultiXactMemberCtl->PagePrecedes = MultiXactMemberPagePrecedes; SimpleLruInit(MultiXactOffsetCtl, - "MultiXactOffset", NUM_MULTIXACTOFFSET_BUFFERS, 0, + "multixact_offset", NUM_MULTIXACTOFFSET_BUFFERS, 0, MultiXactOffsetSLRULock, "pg_multixact/offsets", LWTRANCHE_MULTIXACTOFFSET_BUFFER, SYNC_HANDLER_MULTIXACT_OFFSET, false); SlruPagePrecedesUnitTests(MultiXactOffsetCtl, MULTIXACT_OFFSETS_PER_PAGE); SimpleLruInit(MultiXactMemberCtl, - "MultiXactMember", NUM_MULTIXACTMEMBER_BUFFERS, 0, + "multixact_member", NUM_MULTIXACTMEMBER_BUFFERS, 0, MultiXactMemberSLRULock, "pg_multixact/members", LWTRANCHE_MULTIXACTMEMBER_BUFFER, SYNC_HANDLER_MULTIXACT_MEMBER, diff --git a/src/backend/access/transam/subtrans.c b/src/backend/access/transam/subtrans.c index b2ed82ac56..6aa47af43e 100644 --- a/src/backend/access/transam/subtrans.c +++ b/src/backend/access/transam/subtrans.c @@ -200,7 +200,7 @@ void SUBTRANSShmemInit(void) { SubTransCtl->PagePrecedes = SubTransPagePrecedes; - SimpleLruInit(SubTransCtl, "Subtrans", NUM_SUBTRANS_BUFFERS, 0, + SimpleLruInit(SubTransCtl, "subtransaction", NUM_SUBTRANS_BUFFERS, 0, SubtransSLRULock, "pg_subtrans", LWTRANCHE_SUBTRANS_BUFFER, SYNC_HANDLER_NONE, false); diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index 8b24b22293..490c84dc19 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -541,7 +541,7 @@ AsyncShmemInit(void) * names are used in order to avoid wraparound. */ NotifyCtl->PagePrecedes = asyncQueuePagePrecedes; - SimpleLruInit(NotifyCtl, "Notify", NUM_NOTIFY_BUFFERS, 0, + SimpleLruInit(NotifyCtl, "notify", NUM_NOTIFY_BUFFERS, 0, NotifySLRULock, "pg_notify", LWTRANCHE_NOTIFY_BUFFER, SYNC_HANDLER_NONE, true); diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index d62060d58c..09e11680fc 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -812,7 +812,7 @@ SerialInit(void) * Set up SLRU management of the pg_serial data. */ SerialSlruCtl->PagePrecedes = SerialPagePrecedesLogically; - SimpleLruInit(SerialSlruCtl, "Serial", + SimpleLruInit(SerialSlruCtl, "serializable", NUM_SERIAL_BUFFERS, 0, SerialSLRULock, "pg_serial", LWTRANCHE_SERIAL_BUFFER, SYNC_HANDLER_NONE, false); diff --git a/src/include/utils/pgstat_internal.h b/src/include/utils/pgstat_internal.h index 0cb8a58cba..dbbca31602 100644 --- a/src/include/utils/pgstat_internal.h +++ b/src/include/utils/pgstat_internal.h @@ -269,13 +269,13 @@ typedef struct PgStat_KindInfo * definitions. */ static const char *const slru_names[] = { - "CommitTs", - "MultiXactMember", - "MultiXactOffset", - "Notify", - "Serial", - "Subtrans", - "Xact", + "commit_timestamp", + "multixact_member", + "multixact_offset", + "notify", + "serializable", + "subtransaction", + "transaction", "other" /* has to be last */ }; diff --git a/src/test/isolation/expected/stats.out b/src/test/isolation/expected/stats.out index 61b5a710ec..8c7fe60217 100644 --- a/src/test/isolation/expected/stats.out +++ b/src/test/isolation/expected/stats.out @@ -3039,8 +3039,8 @@ pg_stat_force_next_flush (1 row) step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3093,8 +3093,8 @@ pg_stat_force_next_flush (1 row) step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s2_big_notify: SELECT pg_notify('stats_test_use', @@ -3133,8 +3133,8 @@ pg_stat_force_next_flush (1 row) step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s2_begin: BEGIN; @@ -3176,8 +3176,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_none: SET stats_fetch_consistency = 'none'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3243,8 +3243,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_cache: SET stats_fetch_consistency = 'cache'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3310,8 +3310,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_snapshot: SET stats_fetch_consistency = 'snapshot'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3377,8 +3377,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_none: SET stats_fetch_consistency = 'none'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3450,8 +3450,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_cache: SET stats_fetch_consistency = 'cache'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3523,8 +3523,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_snapshot: SET stats_fetch_consistency = 'snapshot'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3596,8 +3596,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_snapshot: SET stats_fetch_consistency = 'snapshot'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3653,8 +3653,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_snapshot: SET stats_fetch_consistency = 'snapshot'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; diff --git a/src/test/isolation/expected/stats_1.out b/src/test/isolation/expected/stats_1.out index 3854320106..6b965bb955 100644 --- a/src/test/isolation/expected/stats_1.out +++ b/src/test/isolation/expected/stats_1.out @@ -3063,8 +3063,8 @@ pg_stat_force_next_flush (1 row) step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3117,8 +3117,8 @@ pg_stat_force_next_flush (1 row) step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s2_big_notify: SELECT pg_notify('stats_test_use', @@ -3157,8 +3157,8 @@ pg_stat_force_next_flush (1 row) step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s2_begin: BEGIN; @@ -3200,8 +3200,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_none: SET stats_fetch_consistency = 'none'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3267,8 +3267,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_cache: SET stats_fetch_consistency = 'cache'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3334,8 +3334,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_snapshot: SET stats_fetch_consistency = 'snapshot'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3401,8 +3401,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_none: SET stats_fetch_consistency = 'none'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3474,8 +3474,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_cache: SET stats_fetch_consistency = 'cache'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3547,8 +3547,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_snapshot: SET stats_fetch_consistency = 'snapshot'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3620,8 +3620,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_snapshot: SET stats_fetch_consistency = 'snapshot'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; @@ -3677,8 +3677,8 @@ pg_stat_force_next_flush step s1_fetch_consistency_snapshot: SET stats_fetch_consistency = 'snapshot'; step s1_slru_save_stats: - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); step s1_listen: LISTEN stats_test_nothing; step s1_begin: BEGIN; diff --git a/src/test/isolation/specs/stats.spec b/src/test/isolation/specs/stats.spec index a7daf2a49a..1d98ac785b 100644 --- a/src/test/isolation/specs/stats.spec +++ b/src/test/isolation/specs/stats.spec @@ -107,8 +107,8 @@ step s1_table_stats { # SLRU stats steps step s1_slru_save_stats { - INSERT INTO test_slru_stats VALUES('Notify', 'blks_zeroed', - (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'Notify')); + INSERT INTO test_slru_stats VALUES('notify', 'blks_zeroed', + (SELECT blks_zeroed FROM pg_stat_slru WHERE name = 'notify')); } step s1_listen { LISTEN stats_test_nothing; } step s1_big_notify { SELECT pg_notify('stats_test_use', diff --git a/src/test/regress/expected/stats.out b/src/test/regress/expected/stats.out index 346e10a3d2..6e08898b18 100644 --- a/src/test/regress/expected/stats.out +++ b/src/test/regress/expected/stats.out @@ -866,21 +866,21 @@ WHERE pg_stat_get_backend_pid(beid) = pg_backend_pid(); -- Test that resetting stats works for reset timestamp ----- -- Test that reset_slru with a specified SLRU works. -SELECT stats_reset AS slru_commit_ts_reset_ts FROM pg_stat_slru WHERE name = 'CommitTs' \gset -SELECT stats_reset AS slru_notify_reset_ts FROM pg_stat_slru WHERE name = 'Notify' \gset -SELECT pg_stat_reset_slru('CommitTs'); +SELECT stats_reset AS slru_commit_ts_reset_ts FROM pg_stat_slru WHERE name = 'commit_timestamp' \gset +SELECT stats_reset AS slru_notify_reset_ts FROM pg_stat_slru WHERE name = 'notify' \gset +SELECT pg_stat_reset_slru('commit_timestamp'); pg_stat_reset_slru -------------------- (1 row) -SELECT stats_reset > :'slru_commit_ts_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'CommitTs'; +SELECT stats_reset > :'slru_commit_ts_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'commit_timestamp'; ?column? ---------- t (1 row) -SELECT stats_reset AS slru_commit_ts_reset_ts FROM pg_stat_slru WHERE name = 'CommitTs' \gset +SELECT stats_reset AS slru_commit_ts_reset_ts FROM pg_stat_slru WHERE name = 'commit_timestamp' \gset -- Test that multiple SLRUs are reset when no specific SLRU provided to reset function SELECT pg_stat_reset_slru(); pg_stat_reset_slru @@ -888,13 +888,13 @@ SELECT pg_stat_reset_slru(); (1 row) -SELECT stats_reset > :'slru_commit_ts_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'CommitTs'; +SELECT stats_reset > :'slru_commit_ts_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'commit_timestamp'; ?column? ---------- t (1 row) -SELECT stats_reset > :'slru_notify_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'Notify'; +SELECT stats_reset > :'slru_notify_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'notify'; ?column? ---------- t diff --git a/src/test/regress/sql/stats.sql b/src/test/regress/sql/stats.sql index e3b4ca96e8..d8ac0d06f4 100644 --- a/src/test/regress/sql/stats.sql +++ b/src/test/regress/sql/stats.sql @@ -447,16 +447,16 @@ WHERE pg_stat_get_backend_pid(beid) = pg_backend_pid(); ----- -- Test that reset_slru with a specified SLRU works. -SELECT stats_reset AS slru_commit_ts_reset_ts FROM pg_stat_slru WHERE name = 'CommitTs' \gset -SELECT stats_reset AS slru_notify_reset_ts FROM pg_stat_slru WHERE name = 'Notify' \gset -SELECT pg_stat_reset_slru('CommitTs'); -SELECT stats_reset > :'slru_commit_ts_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'CommitTs'; -SELECT stats_reset AS slru_commit_ts_reset_ts FROM pg_stat_slru WHERE name = 'CommitTs' \gset +SELECT stats_reset AS slru_commit_ts_reset_ts FROM pg_stat_slru WHERE name = 'commit_timestamp' \gset +SELECT stats_reset AS slru_notify_reset_ts FROM pg_stat_slru WHERE name = 'notify' \gset +SELECT pg_stat_reset_slru('commit_timestamp'); +SELECT stats_reset > :'slru_commit_ts_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'commit_timestamp'; +SELECT stats_reset AS slru_commit_ts_reset_ts FROM pg_stat_slru WHERE name = 'commit_timestamp' \gset -- Test that multiple SLRUs are reset when no specific SLRU provided to reset function SELECT pg_stat_reset_slru(); -SELECT stats_reset > :'slru_commit_ts_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'CommitTs'; -SELECT stats_reset > :'slru_notify_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'Notify'; +SELECT stats_reset > :'slru_commit_ts_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'commit_timestamp'; +SELECT stats_reset > :'slru_notify_reset_ts'::timestamptz FROM pg_stat_slru WHERE name = 'notify'; -- Test that reset_shared with archiver specified as the stats type works SELECT stats_reset AS archiver_reset_ts FROM pg_stat_archiver \gset