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

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: dbf3f97) | patch
Fix data loss at inplace update after heap_update().
2024年9月24日 22:25:18 +0000 (15:25 -0700)
2024年9月24日 22:25:18 +0000 (15:25 -0700)
commit a07e03fd8fa7daf4d1356f7cb501ffe784ea6257
Fix data loss at inplace update after heap_update().

As previously-added tests demonstrated, heap_inplace_update() could
instead update an unrelated tuple of the same catalog. It could lose
the update. Losing relhasindex=t was a source of index corruption.
Inplace-updating commands like VACUUM will now wait for heap_update()
commands like GRANT TABLE and GRANT DATABASE. That isn't ideal, but a
long-running GRANT already hurts VACUUM progress more just by keeping an
XID running. The VACUUM will behave like a DELETE or UPDATE waiting for
the uncommitted change.

For implementation details, start at the systable_inplace_update_begin()
header comment and README.tuplock. Back-patch to v12 (all supported
versions). In back branches, retain a deprecated heap_inplace_update(),
for extensions.

Reported by Smolkin Grigory. Reviewed by Nitin Motiani, (in earlier
versions) Heikki Linnakangas, and (in earlier versions) Alexander
Lakhin.

Discussion: https://postgr.es/m/CAMp+ueZQz3yDk7qg42hk6-9gxniYbp-=bG2mgqecErqR5gGGOA@mail.gmail.com
16 files changed:
src/backend/access/heap/README.tuplock diff | blob | blame | history
src/backend/access/heap/heapam.c diff | blob | blame | history
src/backend/access/index/genam.c diff | blob | blame | history
src/backend/catalog/index.c diff | blob | blame | history
src/backend/catalog/toasting.c diff | blob | blame | history
src/backend/commands/dbcommands.c diff | blob | blame | history
src/backend/commands/event_trigger.c diff | blob | blame | history
src/backend/commands/vacuum.c diff | blob | blame | history
src/include/access/genam.h diff | blob | blame | history
src/include/access/heapam.h diff | blob | blame | history
src/test/isolation/expected/intra-grant-inplace-db.out diff | blob | blame | history
src/test/isolation/expected/intra-grant-inplace.out diff | blob | blame | history
src/test/isolation/specs/intra-grant-inplace-db.spec diff | blob | blame | history
src/test/isolation/specs/intra-grant-inplace.spec diff | blob | blame | history
src/test/modules/injection_points/expected/inplace.out diff | blob | blame | history
src/test/modules/injection_points/specs/inplace.spec diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

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