Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 74eaf66

Browse filesBrowse files
committed
Call WaitLSNCleanup() in AbortTransaction()
Even though waiting for replay LSN happens without explicit transaction, AbortTransaction() is responsible for the cleanup of the shared memory if the error is thrown in a stored procedure. So, we need to do WaitLSNCleanup() there to clean up after some unexpected error happened while waiting for replay LSN. Discussion: https://postgr.es/m/202404051815.eri4u5q6oj26%40alvherre.pgsql Author: Alvaro Herrera
1 parent ee79928 commit 74eaf66
Copy full SHA for 74eaf66

File tree

1 file changed

+6
-0
lines changed
Filter options
  • src/backend/access/transam

1 file changed

+6
-0
lines changed

‎src/backend/access/transam/xact.c

Copy file name to clipboardExpand all lines: src/backend/access/transam/xact.c
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "commands/async.h"
3939
#include "commands/tablecmds.h"
4040
#include "commands/trigger.h"
41+
#include "commands/waitlsn.h"
4142
#include "common/pg_prng.h"
4243
#include "executor/spi.h"
4344
#include "libpq/be-fsstubs.h"
@@ -2771,6 +2772,11 @@ AbortTransaction(void)
27712772
*/
27722773
LWLockReleaseAll();
27732774

2775+
/*
2776+
* Cleanup waiting for LSN if any.
2777+
*/
2778+
WaitLSNCleanup();
2779+
27742780
/* Clear wait information and command progress indicator */
27752781
pgstat_report_wait_end();
27762782
pgstat_progress_end_command();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.