mirror of
https://github.com/postgres/postgres.git
synced 2025-08-17 01:02:17 +03:00
Teach standby conflict resolution to use SIGUSR1
Conflict reason is passed through directly to the backend, so we can take decisions about the effect of the conflict based upon the local state. No specific changes, as yet, though this prepares for later work. CancelVirtualTransaction() sends signals while holding ProcArrayLock. Introduce errdetail_abort() to give message detail explaining that the abort was caused by conflict processing. Remove CONFLICT_MODE states in favour of using PROCSIG_RECOVERY_CONFLICT states directly, for clarity.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/storage/ipc/procsignal.c,v 1.2 2010/01/02 16:57:51 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/storage/ipc/procsignal.c,v 1.3 2010/01/16 10:05:50 sriggs Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -24,6 +24,8 @@
|
||||
#include "storage/procsignal.h"
|
||||
#include "storage/shmem.h"
|
||||
#include "storage/sinval.h"
|
||||
#include "storage/standby.h"
|
||||
#include "tcop/tcopprot.h"
|
||||
|
||||
|
||||
/*
|
||||
@@ -258,5 +260,17 @@ procsignal_sigusr1_handler(SIGNAL_ARGS)
|
||||
if (CheckProcSignal(PROCSIG_NOTIFY_INTERRUPT))
|
||||
HandleNotifyInterrupt();
|
||||
|
||||
if (CheckProcSignal(PROCSIG_RECOVERY_CONFLICT_DATABASE))
|
||||
RecoveryConflictInterrupt(PROCSIG_RECOVERY_CONFLICT_DATABASE);
|
||||
|
||||
if (CheckProcSignal(PROCSIG_RECOVERY_CONFLICT_TABLESPACE))
|
||||
RecoveryConflictInterrupt(PROCSIG_RECOVERY_CONFLICT_TABLESPACE);
|
||||
|
||||
if (CheckProcSignal(PROCSIG_RECOVERY_CONFLICT_LOCK))
|
||||
RecoveryConflictInterrupt(PROCSIG_RECOVERY_CONFLICT_LOCK);
|
||||
|
||||
if (CheckProcSignal(PROCSIG_RECOVERY_CONFLICT_SNAPSHOT))
|
||||
RecoveryConflictInterrupt(PROCSIG_RECOVERY_CONFLICT_SNAPSHOT);
|
||||
|
||||
errno = save_errno;
|
||||
}
|
||||
|
Reference in New Issue
Block a user