pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christopher Browne <cbbrowne@gmail.com>
Cc: Greg Stark <gsstark@mit.edu>
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Maxim Boguk <maxim.boguk@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #5946: Long exclusive lock taken by vacuum (not full)
Date: Fri, 25 Mar 2011 17:56:22 -0400
Message-ID: <16570.1301090182@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTikha-8Mwa1iLhWV5XTRipqFr1xZFrSUhDuoBZ89@mail.gmail.com>
References: <201103250856.p2P8ufGc004544@wwwmaster.postgresql.org>
	<4345.1301066239@sss.pgh.pa.us>
	<AANLkTimiCkmZ5NL=iPUG08TRAd-OJp_M1sR2SCm6c2BL@mail.gmail.com>
	<13556.1301069421@sss.pgh.pa.us>
	<1301080686-sup-7539@alvh.no-ip.org>
	<15329.1301082238@sss.pgh.pa.us>
	<AANLkTimuzhLR64DiNJq8QcMpgKBBmuW6eiErqZCVp+jk@mail.gmail.com>
	<16028.1301086103@sss.pgh.pa.us>
	<AANLkTik11YkL2Otst7Uf0f-_3+YmTh6O8tFyg8CnQ5o2@mail.gmail.com>
	<AANLkTikha-8Mwa1iLhWV5XTRipqFr1xZFrSUhDuoBZ89@mail.gmail.com>

Christopher Browne <cbbrowne@gmail.com> writes:
> What seems natural-ish to me might include:
> - Stomping a bit on the FSM replacement to make sure nobody's going to
> be writing to the later extensions;
> - Watching free space during the process so the "first" extension gets
> re-opened up if the free space in the much earlier parts of the table
> (e.g. - that are not planned to be dropped off) is running out.

You seem to be thinking only about the possibility that somebody would
try to write a new tuple into the space-to-be-freed.  The problem that
necessitates use of AccessExclusiveLock is that somebody could be doing
a seqscan that tries to *read* the blocks that are about to be truncated
away.  We can't really improve matters much here unless we think of a
way to fix that.  It would be okay if the scan just ignored blocks it
failed to read, but how do you distinguish the case from a filesystem
error that really should be reported?

			regards, tom lane



view thread (30+ messages)  latest in thread

Message-ID: <16570.1301090182@sss.pgh.pa.us>
Permalink:  ../16570.1301090182@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16570.1301090182@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, cbbrowne@gmail.com, gsstark@mit.edu, alvherre@commandprompt.com, maxim.boguk@gmail.com
  Subject: Re: BUG #5946: Long exclusive lock taken by vacuum (not full)
  In-Reply-To: <16570.1301090182@sss.pgh.pa.us>
  References: <201103250856.p2P8ufGc004544@wwwmaster.postgresql.org> <4345.1301066239@sss.pgh.pa.us> <AANLkTimiCkmZ5NL=iPUG08TRAd-OJp_M1sR2SCm6c2BL@mail.gmail.com> <13556.1301069421@sss.pgh.pa.us> <1301080686-sup-7539@alvh.no-ip.org> <15329.1301082238@sss.pgh.pa.us> <AANLkTimuzhLR64DiNJq8QcMpgKBBmuW6eiErqZCVp+jk@mail.gmail.com> <16028.1301086103@sss.pgh.pa.us> <AANLkTik11YkL2Otst7Uf0f-_3+YmTh6O8tFyg8CnQ5o2@mail.gmail.com> <AANLkTikha-8Mwa1iLhWV5XTRipqFr1xZFrSUhDuoBZ89@mail.gmail.com> <16570.1301090182@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox