pgsql: pgstat: fix small bug in pgstat_drop_relation().

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pgstat: fix small bug in pgstat_drop_relation().
Date: 2022-04-07 06:39:53
Message-ID: E1ncLo9-000hD7-1t@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pgstat: fix small bug in pgstat_drop_relation().

Just after committing 5891c7a8ed8, a test running with debug_discard_caches=1
failed locally...

pgstat_drop_relation() neither checked pgstat_should_count_relation() nor
called pgstat_prep_relation_pending(). With debug_discard_caches=1
rel->pgstat_info wasn't set up, leading pg_stat_get_xact_tuples_inserted()
spuriously still returning > 0 while in the transaction dropping the table.

Branch
------
master

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

Modified Files
--------------
src/backend/utils/activity/pgstat_relation.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message John Naylor 2022-04-07 07:01:14 Re: pgsql: pgstat: add pg_stat_force_next_flush(), use it to simplify tests
Previous Message Andres Freund 2022-04-07 06:35:27 Re: pgsql: pgstat: store statistics in shared memory.