Hi,
This change seems to have introduced an issue where a deleted context
can be restored. This happens when a replication command exports a
snapshot since the transaction used is aborted at the start of the
next command. This leads to a memory context allocated with itself as
a parent and child, triggering an infinite loop when attempting to
delete it. I've written more details in a separate thread[1].
[1]: https://www.postgresql.org/message-id/flat/CAO6_XqoJA7-_G6t7Uqe5nWF3nj+QBGn4F6Ptp=rUGDr0zo+KvA@mail.gmail.com