mirror of
https://github.com/postgres/postgres.git
synced 2025-05-01 01:04:50 +03:00
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
This commit is contained in:
parent
ee79928441
commit
74eaf66f98
@ -38,6 +38,7 @@
|
|||||||
#include "commands/async.h"
|
#include "commands/async.h"
|
||||||
#include "commands/tablecmds.h"
|
#include "commands/tablecmds.h"
|
||||||
#include "commands/trigger.h"
|
#include "commands/trigger.h"
|
||||||
|
#include "commands/waitlsn.h"
|
||||||
#include "common/pg_prng.h"
|
#include "common/pg_prng.h"
|
||||||
#include "executor/spi.h"
|
#include "executor/spi.h"
|
||||||
#include "libpq/be-fsstubs.h"
|
#include "libpq/be-fsstubs.h"
|
||||||
@ -2771,6 +2772,11 @@ AbortTransaction(void)
|
|||||||
*/
|
*/
|
||||||
LWLockReleaseAll();
|
LWLockReleaseAll();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Cleanup waiting for LSN if any.
|
||||||
|
*/
|
||||||
|
WaitLSNCleanup();
|
||||||
|
|
||||||
/* Clear wait information and command progress indicator */
|
/* Clear wait information and command progress indicator */
|
||||||
pgstat_report_wait_end();
|
pgstat_report_wait_end();
|
||||||
pgstat_progress_end_command();
|
pgstat_progress_end_command();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user