pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ed Loehr <eloehr@austin.rr.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-general@postgresql.org
Subject: Re: Vacuum Question
Date: Tue, 06 Jun 2000 01:12:09 -0500
Message-ID: <393C9639.639975A@austin.rr.com> (raw)
References: <20000601091701.631.qmail@mail01.edsamail.com.ph>
	<13854.959924635@sss.pgh.pa.us>
	<3937C85E.88ADA7EC@austin.rr.com>
	<14982.959958663@sss.pgh.pa.us>
	<393C94A7.AC0F4642@austin.rr.com>

Ed Loehr wrote:
> 
> Tom Lane wrote:
> >
> > Ed Loehr <eloehr@austin.rr.com> writes:
> > >> The short answer is that a table being vacuumed is locked against any
> > >> other access, read or write; but only that one table.  You might as
> > >> well leave the rest of the database open for use.
> >
> > > I take it you don't give much credence to the previous reports that
> > > concurrently writing during vacuuming caused corruption?
> >
> > No, not really, for the simple reason that there aren't going to *be*
> > any concurrent writes (or reads either) during a vacuum ... unless our
> > table locking system fails, in which case we've got lots worse problems
> > than vacuum.
> 
> On my way to some performance testing I ran into this repeatable crash
> scenario.  Just wondering if anyone else can reproduce the same or
> explain what is happening.  Could very well be something peculiar/buggy
> about the bash/perl commands...
> 
> First, start up this rather obfuscated perl/bash command which just
> inserts random records forever...
> 
> %  createdb pdb; psql -d pdb -c "create table foo(id serial, t timestamp
> not null default current_timestamp, f float, s varchar, i integer, l
> int8);"; perl -e 'for (my $j = 0; $j < 10000000; $j++ ) { print "--
> Insert #$j\n"; $f = rand(2000000); $i = int(rand(2000000)) % 16000; $l =
> int(rand(2000000000)); $s = chr(65 + int(rand(20))) x int(rand(128));
> $delim = chr(39); print "insert into foo (f,s,i,l) values ($f,
> $delim${s}$delim, $i, $l);\n"; }' | psql -d pdb

Sorry...word-wrap killed that one's cut-n-paste-ability...try this if
you're interested:

createdb pdb; 
psql -d pdb -c "create table foo(
	id serial, 
	t timestamp not null default current_timestamp, 
	f float, 
	s varchar, 
	i integer, 
	l int8);";
perl -e 'for (my $j = 0; $j < 10000000; $j++ ) { 
	print "-- Insert #$j\n"; 
	$f = rand(2000000); 
	$i = int(rand(2000000)) % 16000; 
	$l = int(rand(2000000000)); 
	$s = chr(65 + int(rand(20))) x int(rand(128));
	$delim = chr(39); 
	print "insert into foo (f,s,i,l) values \n";
	print "($f, $delim${s}$delim, $i, $l);\n"; }' | psql -d pdb
> 
> Then, start this one in another bash window/terminal/whatever...
> 
> % while test 1; do echo -n "`date`: "; psql -d pdb -c "vacuum analyze;
> select count(*) from foo;"; sleep 3; done
> 
> This seems to consistently crash after the first vacuum with the
> following message:
> 
> NOTICE:  Message from PostgreSQL backend:
>         The Postmaster has informed me that some other backend died
> abnormally and possibly corrupted shared memory.
>         I have rolled back the current transaction and am going to
> terminate your database system connection and exit.
>         Please reconnect to the database system and repeat your query.
> pqReadData() -- backend closed the channel unexpectedly.
>         This probably means the backend terminated abnormally
>         before or while processing the request.
> connection to server was lost
> 
> Regards,
> Ed Loehr



view thread (33+ messages)  latest in thread

Message-ID: <393C9639.639975A@austin.rr.com>
Permalink:  ../393C9639.639975A@austin.rr.com/
Also on:    postgresql.org/message-id/393C9639.639975A@austin.rr.com

 · 

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-general@postgresql.org
  Cc: eloehr@austin.rr.com, tgl@sss.pgh.pa.us
  Subject: Re: Vacuum Question
  In-Reply-To: <393C9639.639975A@austin.rr.com>
  References: <20000601091701.631.qmail@mail01.edsamail.com.ph> <13854.959924635@sss.pgh.pa.us> <3937C85E.88ADA7EC@austin.rr.com> <14982.959958663@sss.pgh.pa.us> <393C94A7.AC0F4642@austin.rr.com> <393C9639.639975A@austin.rr.com>

* 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