Prevent race condition while reading relmapper file.
Heikki Linnakangas <heikki.linnakangas@iki.fi>
Prevent race condition while reading relmapper file. Contrary to the comment here, POSIX does not guarantee atomicity of a read(), if another process calls write() concurrently. Or at least Linux does not. Add locking to load_relmap_file() to avoid the race condition. Fixes bug #17064. Thanks to Alexander Lakhin for the report and test case. Backpatch-through: 9.6, all supported versions. Discussion: https://www.postgresql.org/message-id/17064-bb0d7904ef72add3@postgresql.org
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/cache/relmapper.c | modified | +20 −14 |
Discussion
- BUG #17064: Parallel VACUUM operations cause the error "global/pg_filenode.map contains incorrect checksum" 16 messages · 2021-06-18 → 2021-06-28