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

Re: Logging conflicted queries on deadlocks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Logging conflicted queries on deadlocks
Date: 2008-03-23 02:42:08
Message-ID: 26736.1206240128@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> I think we should report to the client where it is not a security
> breach, and to the server log otherwise.

Well, the point of my original comment is that it's not always so
obvious what might be a security breach or not.

> I'm not sure about warts.  A separate server-only context field perhaps?
> Or a separate flag in ErrorData elements saying whether each particular
> one should go to server only.

Yeah, one or the other.  I was actually thinking about a server-only
addition to the detail field, because using CONTEXT for this doesn't
really seem like quite the right thing --- if the deadlock occurs inside
a function or some other place where lines will get appended to CONTEXT,
it could be confusing.  If we're going to add features to elog.c to
support this specific case, what I'd rather have is

DETAIL: Process A waits for ...
Process B waits for ...
Process A: <query text>
Process B: <query text>

where the second group of lines only appears in the server log.

> If we add that, perhaps we could clean up the stuff in
> checkSharedDependency with it, too.

Hmm, hadn't realized there were other use-cases already.  That makes me
a little more willing to spend effort here.  Not sure that the above
design quite works for pg_shdepend though.  Do we need two independent
strings for client and log details?

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Guillaume SmetDate: 2008-03-23 07:56:10
Subject: Re: Logging conflicted queries on deadlocks
Previous:From: Alvaro HerreraDate: 2008-03-23 02:29:44
Subject: Re: Logging conflicted queries on deadlocks

pgsql-patches by date

Next:From: Guillaume SmetDate: 2008-03-23 07:56:10
Subject: Re: Logging conflicted queries on deadlocks
Previous:From: Alvaro HerreraDate: 2008-03-23 02:29:44
Subject: Re: Logging conflicted queries on deadlocks

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