Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: aamelnikov@inbox.ru
Cc: pgsql-hackers@lists.postgresql.org
Date: 2022-09-07T07:39:46Z
Lists: pgsql-hackers
At Tue, 6 Sep 2022 14:02:53 +0300, "Anton A. Melnikov" <aamelnikov@inbox.ru> wrote in > Can we treat such behavior as a bug? Depends on how we see the counter value. I think this can be annoying but not a bug. CreateRestartPoint already handles that case. While standby is well catching up, startup may make requests once per segment switch while primary is running the latest checkpoint since standby won't receive a checkpoint record until the primary ends the last checkpoint. > If so it seems possible to check if a creating of restartpoint is > obviously impossible before sending request and don't send it at all > if so. > > The patch applied tries to fix it. It lets XLogPageRead run the same check with what CreateRestartPoint does, so it basically works (it is forgetting a lock, though. The reason for omitting the lock in CreateRestartPoint is that it knows checkopinter is the only updator of the shared variable.). I'm not sure I like that for the code duplication. I'm not sure we need to fix that but if we do that, I would impletent IsNewCheckPointWALRecs() using XLogCtl->RedoRecPtr and XLogCtl->lastCheckPoint.redo instead since they are protected by the same lock, and they work more correct way, that is, that can avoid restartpoint requests while the last checkpoint is running. And I would rename it as RestartPointAvailable() or something like that. Or I might want to add XLogRestartpointNeeded(readSegNo) to reduce the required number of info_lck by reading XLogCtl members at once. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Improve descriptions of some pg_stat_checkpoints functions in pg_proc.dat.
- 1909835c28a1 18.0 landed
-
docs: Enhance the pg_stat_checkpointer view documentation.
- a19f83f87966 18.0 landed
-
Add num_done counter to the pg_stat_checkpointer view.
- 559efce1d684 18.0 landed
-
docs: Improve the description of num_timed column in pg_stat_checkpointer.
- fa3a022136fc 17.0 landed
- a7c39db5eb34 18.0 landed
-
Improve documentation for pg_stat_checkpointer fields
- e820db5b56b2 17.0 landed
-
Enhance checkpointer restartpoint statistics
- 12915a58eec9 17.0 landed
-
Introduce pg_stat_checkpointer
- 96f052613f35 17.0 cited