Skip to content

Commit c21e6e2

Browse files
committed
Clear CurrentResourceOwner earlier in CommitTransaction.
Alexander reported a crash with repeated create + drop database, after the ResourceOwner rewrite (commit b8bff07). That was fixed by the previous commit, but it nevertheless seems like a good idea clear CurrentResourceOwner earlier, because you're not supposed to use it for anything after we start releasing it. Reviewed-by: Alexander Lakhin Discussion: https://www.postgresql.org/message-id/11b70743-c5f3-3910-8e5b-dd6c115ff829%40gmail.com
1 parent 325f540 commit c21e6e2

File tree

1 file changed

+1
-1
lines changed
  • src/backend/access/transam

1 file changed

+1
-1
lines changed

src/backend/access/transam/xact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2309,6 +2309,7 @@ CommitTransaction(void)
23092309
CallXactCallbacks(is_parallel_worker ? XACT_EVENT_PARALLEL_COMMIT
23102310
: XACT_EVENT_COMMIT);
23112311

2312+
CurrentResourceOwner = NULL;
23122313
ResourceOwnerRelease(TopTransactionResourceOwner,
23132314
RESOURCE_RELEASE_BEFORE_LOCKS,
23142315
true, true);
@@ -2374,7 +2375,6 @@ CommitTransaction(void)
23742375
AtEOXact_LogicalRepWorkers(true);
23752376
pgstat_report_xact_timestamp(0);
23762377

2377-
CurrentResourceOwner = NULL;
23782378
ResourceOwnerDelete(TopTransactionResourceOwner);
23792379
s->curTransactionOwner = NULL;
23802380
CurTransactionResourceOwner = NULL;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy