git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: b669293) | patch
Assert lack of hazardous buffer locks before possible catalog read.
2025年4月17日 12:00:30 +0000 (05:00 -0700)
2025年4月17日 12:00:30 +0000 (05:00 -0700)
commit f4ece891fc2f3f96f0571720a1ae30db8030681b
Assert lack of hazardous buffer locks before possible catalog read.

Commit 0bada39c83a150079567a6e97b1a25a198f30ea3 fixed a bug of this kind,
which existed in all branches for six days before detection. While the
probability of reaching the trouble was low, the disruption was extreme. No
new backends could start, and service restoration needed an immediate
shutdown. Hence, add this to catch the next bug like it.

The new check in RelationIdGetRelation() suffices to make autovacuum detect
the bug in commit 243e9b40f1b2dd09d6e5bf91ebf6e822a2cd3704 that led to commit
0bada39. This also checks in a number of similar places. It replaces each
Assert(IsTransactionState()) that pertained to a conditional catalog read.

No back-patch for now, but a back-patch of commit 243e9b4 should back-patch
this, too. A back-patch could omit the src/test/regress changes, since back
branches won't gain new index columns.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: https://postgr.es/m/20250410191830.0e.nmisch@google.com
Discussion: https://postgr.es/m/10ec0bc3-5933-1189-6bb8-5dec4114558e@gmail.com
15 files changed:
src/backend/catalog/catalog.c diff | blob | blame | history
src/backend/storage/buffer/bufmgr.c diff | blob | blame | history
src/backend/storage/lmgr/lwlock.c diff | blob | blame | history
src/backend/utils/adt/pg_locale.c diff | blob | blame | history
src/backend/utils/cache/catcache.c diff | blob | blame | history
src/backend/utils/cache/inval.c diff | blob | blame | history
src/backend/utils/cache/relcache.c diff | blob | blame | history
src/backend/utils/mb/mbutils.c diff | blob | blame | history
src/include/catalog/catalog.h diff | blob | blame | history
src/include/storage/bufmgr.h diff | blob | blame | history
src/include/storage/lwlock.h diff | blob | blame | history
src/include/utils/relcache.h diff | blob | blame | history
src/test/regress/expected/type_sanity.out diff | blob | blame | history
src/test/regress/regress.c diff | blob | blame | history
src/test/regress/sql/type_sanity.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /