Re: [bugfix] DISCARD ALL does not release advisory locks

From: "Marko Kreen" <markokr(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Postgres Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bugfix] DISCARD ALL does not release advisory locks
Date: 2008-11-24 15:25:09
Message-ID: e51f66da0811240725x5710bb5bhdfbb8aafccd8579@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/24/08, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Marko Kreen" <markokr(at)gmail(dot)com> writes:
> > It was brought to my attention that DISCARD ALL
> > does not release advisory locks:
>
> What is the argument that it should?

DISCARD ALL is supposed to be used by poolers to reset connection
back to startup state to reuse server connection after client
disconnect. New client should see no difference between fresh
backend and old backend where DISCARD ALL was issued.

IOW, DISCARD ALL should be functionally equivalent to backend exit.

If user want more explicit control over what resources are released,
he should avoid use of DISCARD ALL, instead he should manually pick
individual components from the command sequence DISCARD ALL
is equivalent to. Eg. when user wants to keep old plans or
advisory locks around, he should manually construct command list
that resets everything except those.

But DISCARD ALL should release everything possible, never should additional
commands be needed in addition to it to do full reset.

--
marko

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-11-24 15:29:22 Re: [PATCHES] Solve a problem of LC_TIME of windows.
Previous Message Gregory Stark 2008-11-24 15:23:31 Re: Visibility map, partial vacuums