postgresql/src/backend
Amit Kapila 58cf794ca6 Fix reorder buffer memory accounting for toast changes.
While processing toast changes in logical decoding, we rejigger the
tuple change to point to in-memory toast tuples instead to on-disk toast
tuples. And, to make sure the memory accounting is correct, we were
subtracting the old change size and then after re-computing the new tuple,
re-adding its size at the end. Now, if there is any error before we add
the new size, we will release the changes and that will update the
accounting info (subtracting the size from the counters). And we were
underflowing there which leads to an assertion failure in assert enabled
builds and wrong memory accounting in reorder buffer otherwise.

Author: Bertrand Drouvot
Reviewed-by: Amit Kapila
Backpatch-through: 13, where memory accounting was introduced
Discussion: https://postgr.es/m/92b0ee65-b8bd-e42d-c082-4f3f4bf12d34@amazon.com
2021-09-13 10:46:58 +05:30
..
access Further portability tweaks for float4/float8 hash functions. 2021-09-04 16:29:08 -04:00
bootstrap Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
catalog Fix lookup error in extended stats ownership check 2021-08-31 18:38:11 +02:00
commands Fix some anomalies with NO SCROLL cursors. 2021-09-10 13:18:32 -04:00
executor Get rid of artificial restriction on hash table sizes on Windows. 2021-07-25 14:02:27 -04:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit jit: Don't inline functions that access thread-locals. 2021-07-22 15:07:52 +12:00
lib Fix typo in comment 2021-04-20 14:36:41 +02:00
libpq Set type identifier on BIO 2021-08-17 14:31:00 +02:00
main Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nodes Ensure that expandTableLikeClause() re-examines the same table. 2020-12-01 14:02:27 -05:00
optimizer Get rid of artificial restriction on hash table sizes on Windows. 2021-07-25 14:02:27 -04:00
parser Avoid using ambiguous word "positive" in error message. 2021-08-25 11:47:46 +09:00
partitioning Avoid using ambiguous word "non-negative" in error messages. 2021-07-28 01:21:52 +09:00
po Translation updates 2021-08-09 11:56:40 +02:00
port Make EXEC_BACKEND more convenient on macOS. 2021-08-13 11:11:38 +12:00
postmaster Revert "Avoid creating archive status ".ready" files too early" 2021-09-04 12:14:30 -04:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:19:49 -04:00
replication Fix reorder buffer memory accounting for toast changes. 2021-09-13 10:46:58 +05:30
rewrite Fix rewriter to set hasModifyingCTE correctly on rewritten queries. 2021-09-08 12:05:43 -04:00
snowball Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statistics Use correct spelling of statistics kind 2021-03-23 05:00:19 +01:00
storage Check for relation length overrun soon enough. 2021-09-09 11:45:48 -04:00
tcop Fix some anomalies with NO SCROLL cursors. 2021-09-10 13:18:32 -04:00
tsearch Don't leak compiled regex(es) when an ispell cache entry is dropped. 2021-03-18 21:44:43 -04:00
utils Fix bogus timetz_zone() results for DYNTZ abbreviations. 2021-09-06 11:29:52 -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 Update copyrights for 2020 2020-01-01 12:21:45 -05:00
nls.mk Translation updates 2020-09-14 13:14:53 +02:00