mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Add views and functions to monitor hot standby query conflicts
Add the view pg_stat_database_conflicts and a column to pg_stat_database, and the underlying functions to provide the information.
This commit is contained in:
@ -2903,15 +2903,21 @@ ProcessInterrupts(void)
|
||||
(errcode(ERRCODE_ADMIN_SHUTDOWN),
|
||||
errmsg("terminating autovacuum process due to administrator command")));
|
||||
else if (RecoveryConflictPending && RecoveryConflictRetryable)
|
||||
{
|
||||
pgstat_report_recovery_conflict(RecoveryConflictReason);
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
|
||||
errmsg("terminating connection due to conflict with recovery"),
|
||||
errdetail_recovery_conflict()));
|
||||
}
|
||||
else if (RecoveryConflictPending)
|
||||
{
|
||||
pgstat_report_recovery_conflict(RecoveryConflictReason);
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_ADMIN_SHUTDOWN),
|
||||
errmsg("terminating connection due to conflict with recovery"),
|
||||
errdetail_recovery_conflict()));
|
||||
}
|
||||
else
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_ADMIN_SHUTDOWN),
|
||||
@ -2956,6 +2962,7 @@ ProcessInterrupts(void)
|
||||
RecoveryConflictPending = false;
|
||||
DisableNotifyInterrupt();
|
||||
DisableCatchupInterrupt();
|
||||
pgstat_report_recovery_conflict(RecoveryConflictReason);
|
||||
if (DoingCommandRead)
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
|
||||
|
Reference in New Issue
Block a user