Received: from Mail.austin.rr.com (sm2.texas.rr.com [24.93.35.55]) by hub.org (8.10.1/8.10.1) with ESMTP id e5666UW83973 for ; Tue, 6 Jun 2000 02:06:30 -0400 (EDT) Received: from austin.rr.com ([24.93.36.87]) by Mail.austin.rr.com with Microsoft SMTPSVC(5.5.1877.357.35); Tue, 6 Jun 2000 00:53:08 -0500 Message-ID: <393C9639.639975A@austin.rr.com> Date: Tue, 06 Jun 2000 01:12:09 -0500 From: Ed Loehr X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.12-20smp i686) X-Accept-Language: en MIME-Version: 1.0 To: Tom Lane , pgsql-general@postgresql.org Subject: Re: Vacuum Question 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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200006/142 Ed Loehr wrote: > > Tom Lane wrote: > > > > Ed Loehr 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