postgresql/src/backend
Noah Misch 8590c942c1 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
2024-09-24 15:25:23 -07:00
..
access Fix data loss at inplace update after heap_update(). 2024-09-24 15:25:23 -07:00
backup Skip .DS_Store files in server side utils 2024-02-13 13:47:12 +01:00
bootstrap Process session_preload_libraries within InitPostgres's transaction. 2022-07-25 10:27:43 -04:00
catalog Fix data loss at inplace update after heap_update(). 2024-09-24 15:25:23 -07:00
commands Fix data loss at inplace update after heap_update(). 2024-09-24 15:25:23 -07:00
executor Add missing query ID reporting in extended query protocol 2024-09-18 09:59:23 +09:00
foreign Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:25 -07:00
jit Fix illegal attribute propagation in LLVM JIT. 2024-04-10 12:14:04 +12:00
lib Fix lock assertions in dshash.c. 2022-07-11 16:01:22 +12:00
libpq Fix regression in TLS session ticket disabling 2024-08-19 12:55:11 +02:00
main Fix outdated --help message for postgres -f 2022-08-15 13:37:32 +09:00
nodes Handle WindowClause.runCondition in tree walker/mutator functions. 2024-01-10 13:36:34 -05:00
optimizer Don't enter parallel mode when holding interrupts. 2024-09-17 19:54:26 -07:00
parser Repair pg_upgrade for identity sequences with non-default persistence. 2024-09-17 15:53:26 -04:00
partitioning Fix creation of partition descriptor during concurrent detach+drop 2024-08-12 18:17:56 -04:00
po Translation updates 2024-08-05 12:20:32 +02:00
port Close socket in case of errors in setting non-blocking 2024-01-17 11:24:11 +01:00
postmaster Fix bugs in MultiXact truncation 2024-06-26 23:05:58 +03:00
regex Avoid character classification in regex escape parsing. 2023-04-21 08:20:17 -07:00
replication Fix possibility of logical decoding partial transaction changes. 2024-07-11 22:48:16 +09:00
rewrite Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:25 -07:00
snowball In the Snowball dictionary, don't try to stem excessively-long words. 2022-08-31 10:42:05 -04:00
statistics Fix incorrectly reported stats kind in "can't happen" ERROR 2024-03-05 16:18:19 +13:00
storage Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions. 2024-09-24 15:25:23 -07:00
tcop Add missing query ID reporting in extended query protocol 2024-09-18 09:59:23 +09:00
tsearch Limit to_tsvector_byid's initial array allocation to something sane. 2023-09-25 11:50:28 -04:00
utils Replace usages of xmlXPathCompile() with xmlXPathCtxtCompile(). 2024-09-15 13:33:09 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Move basebackup code to new directory src/backend/backup 2022-08-10 14:03:09 -04:00
nls.mk Translation updates 2023-11-06 13:16:22 +01:00