Save FSM/VM pages on normal shutdown (#11449)

## Problem

See https://neondb.slack.com/archives/C03QLRH7PPD/p1743746717119179

We wallow FSM/VM pages when they are written to disk to persist them in
PS.
But it is not happen during shutdown checkpoint, because writing to WAL
during checkpoint cause Postgres panic.

## Summary of changes

Move `CheckPointBuffers` call to `PreCheckPointGuts`

Postgres PRs:
https://github.com/neondatabase/postgres/pull/615
https://github.com/neondatabase/postgres/pull/614
https://github.com/neondatabase/postgres/pull/613
https://github.com/neondatabase/postgres/pull/612

---------

Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
This commit is contained in:
Konstantin Knizhnik
2025-04-07 16:56:55 +03:00
committed by GitHub
parent 85a515c176
commit 8eb701d706
6 changed files with 8 additions and 9 deletions

View File

@@ -1900,7 +1900,6 @@ neon_wallog_pagev(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
log_pages = true;
}
else if (XLogInsertAllowed() &&
!ShutdownRequestPending &&
(forknum == FSM_FORKNUM || forknum == VISIBILITYMAP_FORKNUM))
{
log_pages = true;

View File

@@ -1,18 +1,18 @@
{
"v17": [
"17.4",
"c9e4ff5a38907acd71107634055bf2609aba43a5"
"66114c23bc61205b0e3fb1e77ee76a4abc1eb4b8"
],
"v16": [
"16.8",
"746bd9ffe5c29bce030eaea1031054057f3c5d45"
"d56e79cd5d6136c159b1d8d98acb7981d4b69364"
],
"v15": [
"15.12",
"23708b3aca9adf163aa0973eb63d9afc0e4a04c3"
"aeb292eeace9072e07071254b6ffc7a74007d4d2"
],
"v14": [
"14.17",
"8cca70c22e2894dd4645f9a940086ac437b0a11b"
"a0391901a2af13aa029b905272a5b2024133c926"
]
}