Re: Flush pgstats file during checkpoints - Mailing list pgsql-hackers

From Bertrand Drouvot
Subject Re: Flush pgstats file during checkpoints
Date
Msg-id Zs6c74aork939m2d@ip-10-97-1-34.eu-west-3.compute.internal
Whole thread Raw
In response to Re: Flush pgstats file during checkpoints  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
Responses Re: Flush pgstats file during checkpoints
List pgsql-hackers
Hi,

On Mon, Aug 26, 2024 at 01:56:40PM +0900, Michael Paquier wrote:
> On Fri, Aug 02, 2024 at 02:11:34AM +0900, Michael Paquier wrote:
> > Applied 0003 for now to add the redo LSN to the pgstats file, adding
> > the redo LSN to the two DEBUG2 entries when reading and writing while
> > on it, that I forgot.  (It was not 01:57 where I am now.)
> > 
> > Attached is the last one.
> 
> The CF bot has been complaining in injection_points as an effect of
> the stats remaining after a crash, so rebased to adapt to that.

Thanks!

Checking the V7 diffs as compared to V4:

1. In pgstat_write_statsfile():

-    elog(DEBUG2, "writing stats file \"%s\"", statfile);
+    elog(DEBUG2, "writing stats file \"%s\" with redo %X/%X", statfile,
+         LSN_FORMAT_ARGS(redo));

2. and the ones in injection_points/t/001_stats.pl:

 +# On crash the stats are still there.
  $node->stop('immediate');
  $node->start;
  $numcalls = $node->safe_psql('postgres',
      "SELECT injection_points_stats_numcalls('stats-notice');");
 -is($numcalls, '', 'number of stats after crash');
 +is($numcalls, '3', 'number of stats after crash');
  $fixedstats = $node->safe_psql('postgres',
      "SELECT * FROM injection_points_stats_fixed();");
 -is($fixedstats, '0|0|0|0|0', 'fixed stats after crash');
 +is($fixedstats, '1|0|2|1|1', 'fixed stats after crash');

They both LGTM.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: consider -Wmissing-variable-declarations
Next
From: Richard Guo
Date:
Subject: Re: Significant Execution Time Difference Between PG13.14 and PG16.4 for Query on information_schema Tables.