Skip site navigation (1) Skip section navigation (2)

Re: Error code for "terminating connection due to conflict with recovery"

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Bruce Momjian <bruce(at)momjian(dot)us>, fgp(at)phlo(dot)org, Tatsuo Ishii <ishii(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Error code for "terminating connection due to conflict with recovery"
Date: 2011-02-03 02:21:06
Message-ID: AANLkTik_pkTE0fJZKP0u0_r7pZNx8obRMyCGojc8G1s5@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, Feb 1, 2011 at 3:17 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> ERRCODE_DATABASE_DROPPED    57P04   looks best

So I guess the only remaining issue is whether we should distinguish
the error message text, as well as the error codes.  Tom was in favor
of that upthread, and I am too.  Right now we have:

                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)
                {
                        /* Currently there is only one non-retryable
recovery conflict */
                        Assert(RecoveryConflictReason ==
PROCSIG_RECOVERY_CONFLICT_DATABASE);
                        pgstat_report_recovery_conflict(RecoveryConflictReason);
                        ereport(FATAL,
                                        (errcode(ERRCODE_DATABASE_DROPPED),
                          errmsg("terminating connection due to
conflict with recovery"),
                                         errdetail_recovery_conflict()));
                }

The simplest thing to do seems to be to make the second one read
"terminating connection because the database has been dropped".

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

pgsql-hackers by date

Next:From: Mladen GogalaDate: 2011-02-03 02:45:19
Subject: Re: [HACKERS] Slow count(*) again...
Previous:From: Robert HaasDate: 2011-02-03 02:12:10
Subject: Re: log_checkpoints and restartpoint

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group