pgsql: pgstat: set timestamps of fixed-numbered stats after a crash.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pgstat: set timestamps of fixed-numbered stats after a crash.
Date: 2022-04-15 00:41:37
Message-ID: E1nfA1p-000YU3-Ml@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pgstat: set timestamps of fixed-numbered stats after a crash.

When not loading stats at startup (i.e. pgstat_discard_stats() getting
called), reset timestamps of fixed numbered stats would be left at
0. Oversight in 5891c7a8ed8.

Instead use pgstat_reset_after_failure() and add tests verifying that
fixed-numbered reset timestamps are set appropriately.

Reported-By: "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAKFQuwamFuaQHKdhcMt4Gbw5+Hca2UE741B8gOOXoA=TtAd2Yw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5cd1c40b3ce9600f129fd1fea9850e1affaf31d5

Modified Files
--------------
src/backend/utils/activity/pgstat.c | 22 ++++++++++++++--------
src/test/recovery/t/029_stats_restart.pl | 10 ++++++++++
2 files changed, 24 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2022-04-15 01:20:46 Re: API stability [was: pgsql: Fix possible recovery trouble if TRUNCATE overlaps a checkpoint.]
Previous Message Alvaro Herrera 2022-04-14 20:23:03 pgsql: Have CLUSTER ignore partitions not owned by caller