From a8ce974cddef3957b0615d743a1d090d12e81d50 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Sat, 16 Jan 2010 10:05:59 +0000 Subject: 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. --- src/include/tcop/tcopprot.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/include/tcop') diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h index 891979dc8a..b46160160e 100644 --- a/src/include/tcop/tcopprot.h +++ b/src/include/tcop/tcopprot.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.102 2010/01/02 16:58:09 momjian Exp $ + * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.103 2010/01/16 10:05:59 sriggs Exp $ * * OLD COMMENTS * This file was created so that other c files could get the two @@ -21,6 +21,7 @@ #include "executor/execdesc.h" #include "nodes/parsenodes.h" +#include "storage/procsignal.h" #include "utils/guc.h" @@ -64,6 +65,7 @@ extern void die(SIGNAL_ARGS); extern void quickdie(SIGNAL_ARGS); extern void StatementCancelHandler(SIGNAL_ARGS); extern void FloatExceptionHandler(SIGNAL_ARGS); +extern void RecoveryConflictInterrupt(ProcSignalReason reason); /* called from SIGUSR1 handler */ extern void prepare_for_client_read(void); extern void client_read_ended(void); extern const char *process_postgres_switches(int argc, char *argv[], -- cgit v1.2.1