Re: Why reset pgstat during recovery

From: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>
To: 蔡梦娟 <mengjuan(dot)cmj(at)alibaba-inc(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Why reset pgstat during recovery
Date: 2021-04-05 10:20:20
Message-ID: 14AD7450-F1F9-47D0-B189-476C8798FD24@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers



On 2021/04/02 18:41, 蔡梦娟(玊于) wrote:
>
> Hi, all
>
> I want to know why call pgstat_reset_all function during recovery
> process, under what circumstances the data will be invalid after recovery?

If my understanding is right, PITR is the case. Now, the stats files are
generated as a one-time snapshot. This means that the stats counters
saved at last may not be valid for the specific point in time.

FWIW, there was a related discussion([1]) although the behavior is not
changed yet.

[1] https://www.postgresql.org/message-id/1416.1479760254%40sss.pgh.pa.us

Regards,
--
Masahiro Ikeda
NTT DATA CORPORATION

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-04-05 11:15:32 Re: [Patch] ALTER SYSTEM READ ONLY
Previous Message Andres Freund 2021-04-05 09:38:32 Re: shared memory stats: high level design decisions: consistency, dropping