postgresql/contrib/test_decoding
Masahiko Sawada 52f1d6730b Fix memory counter update in ReorderBuffer.
Commit 5bec1d6bc5 changed the memory usage updates of the
ReorderBufferTXN to zero all at once by subtracting txn->size, rather
than updating it for each change. However, if TOAST reconstruction
data remained in the transaction when freeing it, there were cases
where it further subtracted the memory counter from zero, resulting in
an assertion failure.

This change calculates the memory size for each change and updates the
memory usage to precisely the amount that has been freed.

Backpatch to v17, where this was introducd.

Reviewed-by: Amit Kapila, Shlok Kyal
Discussion: https://postgr.es/m/CAD21AoAqkNUvicgKPT_dXzNoOwpPkVTg0QPPxEcWmzT0moCJ1g%40mail.gmail.com
Backpatch-through: 17
2024-08-26 11:00:07 -07:00
..
expected Fix memory counter update in ReorderBuffer. 2024-08-26 11:00:07 -07:00
specs Fix possibility of logical decoding partial transaction changes. 2024-07-11 22:48:23 +09:00
sql Fix memory counter update in ReorderBuffer. 2024-08-26 11:00:07 -07:00
t Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore Improve isolation tests infrastructure. 2017-03-14 15:56:17 -07:00
logical.conf Stabilize streaming tests in test_decoding. 2022-04-20 08:59:55 +05:30
Makefile Fix possibility of logical decoding partial transaction changes. 2024-07-11 22:48:23 +09:00
meson.build Fix possibility of logical decoding partial transaction changes. 2024-07-11 22:48:23 +09:00
test_decoding.c Remove ReorderBufferTupleBuf structure. 2024-01-29 10:37:16 +09:00