mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
In AtEOXact_Files, complain if any files remain unclosed at commit.
This change makes this module act more like most of our other low-level
resource management modules. It's a caller error if something is not
explicitly closed by the end of a successful transaction, so issue
a WARNING about it. This would not actually have caught the file leak
bug fixed in commit 231bcd080
, because that was in a transaction-abort
path; but it still seems like a good, and pretty cheap, cross-check.
Discussion: https://postgr.es/m/152056616579.4966.583293218357089052@wrigleys.postgresql.org
This commit is contained in:
@ -2123,7 +2123,7 @@ CommitTransaction(void)
|
||||
AtEOXact_on_commit_actions(true);
|
||||
AtEOXact_Namespace(true, is_parallel_worker);
|
||||
AtEOXact_SMgr();
|
||||
AtEOXact_Files();
|
||||
AtEOXact_Files(true);
|
||||
AtEOXact_ComboCid();
|
||||
AtEOXact_HashTables(true);
|
||||
AtEOXact_PgStat(true);
|
||||
@ -2401,7 +2401,7 @@ PrepareTransaction(void)
|
||||
AtEOXact_on_commit_actions(true);
|
||||
AtEOXact_Namespace(true, false);
|
||||
AtEOXact_SMgr();
|
||||
AtEOXact_Files();
|
||||
AtEOXact_Files(true);
|
||||
AtEOXact_ComboCid();
|
||||
AtEOXact_HashTables(true);
|
||||
/* don't call AtEOXact_PgStat here; we fixed pgstat state above */
|
||||
@ -2603,7 +2603,7 @@ AbortTransaction(void)
|
||||
AtEOXact_on_commit_actions(false);
|
||||
AtEOXact_Namespace(false, is_parallel_worker);
|
||||
AtEOXact_SMgr();
|
||||
AtEOXact_Files();
|
||||
AtEOXact_Files(false);
|
||||
AtEOXact_ComboCid();
|
||||
AtEOXact_HashTables(false);
|
||||
AtEOXact_PgStat(false);
|
||||
|
Reference in New Issue
Block a user