aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2021-09-13 10:35:00 +0530
committerAmit Kapila <akapila@postgresql.org>2021-09-13 10:35:00 +0530
commitf5e0ff4631b5402950db69c989c88c4c6295504b (patch)
tree3671fe22f4eb0c68057445b0792a340931158eee /src/backend/tcop/postgres.c
parentcc057fb315e24b78552f5b7ac05792418042e71b (diff)
downloadpostgresql-f5e0ff4631b5402950db69c989c88c4c6295504b.tar.gz
postgresql-f5e0ff4631b5402950db69c989c88c4c6295504b.zip
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
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions