postgresql/src/backend
Amit Kapila df3640e529 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:24:00 +05:30
..
access Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
bootstrap Fix bogus assertion in BootstrapModeMain(). 2021-08-09 08:28:53 -07:00
catalog Remove Value node struct 2021-09-09 08:36:53 +02:00
commands Fix some anomalies with NO SCROLL cursors. 2021-09-10 13:18:32 -04:00
executor Remove Value node struct 2021-09-09 08:36:53 +02:00
foreign Update copyright for 2021 2021-01-02 13:06:25 -05:00
jit Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
lib Fix typo in comment 2021-04-20 14:35:16 +02:00
libpq Fix incorrect format placeholders 2021-09-08 08:57:05 +02:00
main process startup: Centralize pgwin32_signal_initialize() calls. 2021-08-05 12:36:06 -07:00
nodes Fix _equalA_Const 2021-09-09 10:23:29 +02:00
optimizer Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
parser Remove Value node struct 2021-09-09 08:36:53 +02:00
partitioning Allow ordered partition scans in more cases 2021-08-03 12:25:52 +12:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Make EXEC_BACKEND more convenient on macOS. 2021-08-13 11:09:00 +12:00
postmaster Refactor the syslogger pipe protocol to use a bitmask for its options 2021-09-13 09:03:45 +09:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:19:31 -04:00
replication Fix reorder buffer memory accounting for toast changes. 2021-09-13 10:24:00 +05:30
rewrite Fix rewriter to set hasModifyingCTE correctly on rewritten queries. 2021-09-08 12:05:47 -04:00
snowball Update snowball 2021-02-19 08:10:15 +01:00
statistics Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09: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 Clean up some code using "(expr) ? true : false" 2021-09-08 09:44:04 +09:00
utils Refactor the syslogger pipe protocol to use a bitmask for its options 2021-09-13 09:03:45 +09: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 Use sort_template.h for qsort_tuple() and qsort_ssup(). 2021-03-03 17:02:32 +13:00
nls.mk Translation updates 2021-05-10 14:36:21 +02:00