aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistget.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-03-12 09:59:49 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2014-03-12 10:07:22 +0200
commit91f932cf47fd0e0825b2ec92a06d24648d1ff128 (patch)
tree572bc4603689978a6de7769498cb766e404b2392 /src/backend/access/gist/gistget.c
parentb315b767f7a3a1fb50c51739916de295be37487a (diff)
downloadpostgresql-91f932cf47fd0e0825b2ec92a06d24648d1ff128.tar.gz
postgresql-91f932cf47fd0e0825b2ec92a06d24648d1ff128.zip
In WAL replay, restore GIN metapage unconditionally to avoid torn page.
We don't take a full-page image of the GIN metapage; instead, the WAL record contains all the information required to reconstruct it from scratch. But to avoid torn page hazards, we must re-initialize it from the WAL record every time, even if it already has a greater LSN, similar to how normal full page images are restored. This was highly unlikely to cause any problems in practice, because the GIN metapage is small. We rely on an update smaller than a 512 byte disk sector to be atomic elsewhere, at least in pg_control. But better safe than sorry, and this would be easy to overlook if more fields are added to the metapage so that it's no longer small. Reported by Noah Misch. Backpatch to all supported versions.
Diffstat (limited to 'src/backend/access/gist/gistget.c')
0 files changed, 0 insertions, 0 deletions