Unexpected changes of CurrentResourceOwner and CurrentMemoryContext

Antonin Houska <ah@cybertec.at>

From: Antonin Houska <ah@cybertec.at>
To: pgsql-hackers@lists.postgresql.org
Date: 2025-09-03T09:49:32Z
Lists: pgsql-hackers

Attachments

When working on the REPACK command, we see an ERROR caused by unexpected
change of CurrentResourceOwner [1]. I think the problem is that
reorderbuffer.c does not restore the original value after calling
RollbackAndReleaseCurrentSubTransaction(). The attached patch tries to handle
the call like other callers throughout the tree do.

[1]
https://www.postgresql.org/message-id/CADzfLwUgPMLiFkXRnk97ugPqkDfsNJ3TRdw9gjJM%3D8WB4_nXwQ%40mail.gmail.com

-- 
Antonin Houska
Web: https://www.cybertec-postgresql.com

Commits

  1. Avoid unexpected changes of CurrentResourceOwner and CurrentMemoryContext