Fix memory context of NeonWALReader allocation.

Allocating it in short living context is wrong because it is reused during
backend lifetime.
This commit is contained in:
Arseny Sher
2024-07-11 20:31:15 +03:00
committed by Arseny Sher
parent 814c8e8f68
commit cd29156927
2 changed files with 11 additions and 4 deletions
@@ -247,6 +247,12 @@ FROM generate_series(1, 16384) AS seq; -- Inserts enough rows to exceed 16MB of
cur.execute(
"SELECT * FROM pg_logical_slot_peek_binary_changes('slotty_mcslotface', NULL, NULL, 'include-xids', '0')"
)
# do the peek second time: we've had a bug using wrong memory context
# for NeonWALReader leading to the crash in this case.
log.info("peek_changes again")
cur.execute(
"SELECT * FROM pg_logical_slot_peek_binary_changes('slotty_mcslotface', NULL, NULL, 'include-xids', '0')"
)
# Tests that walsender correctly blocks until WAL is downloaded from safekeepers