Re: pg_dump and write locks

From: "David Parker" <dparker(at)tazznetworks(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_dump and write locks
Date: 2005-07-19 16:34:34
Message-ID: 07FDEE0ED7455A48AC42AC2070EDFF7C8E3FEA@corpsrv2.tazznetworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

What happened was that I realized that here it was already noon on
Tuesday, and I hadn't made a fool of myself in public yet this week....

I blindly took the output from somebody else's query and didn't look at
the pg_locks table myself. Once I was able to look at it with a live
test running, everything is in order, just slow.

Thanks for your response, and apologies for the noise.

- DAP

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Tuesday, July 19, 2005 10:45 AM
To: David Parker
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] pg_dump and write locks

"David Parker" <dparker(at)tazznetworks(dot)com> writes:
> The observed behavior was that a pg_dump running with nothing else
> going on takes a couple of minutes, but when we are running some
> system tests that do heavy updates to a selection of application
> tables, it appears that pg_dump blocks until the update run is done.

Are you sure the other processes aren't taking any exclusive locks?
Are you sure your system isn't saturated to the point where pg_dump just
can't make progress very fast?

> We looked at pg_locks, and saw that the pg_dump process was acquiring
> locks like:
>
> 14764 | ExclusiveLock | 124576072 | COPY public.stats (id,
> description, lastsavedate, lastsaveuser) TO stdout;

It's impossible to tell what you are actually looking at here --- that's
not the raw output of pg_locks, and you've conveniently omitted any
column headers --- but I wonder whether that isn't just the
transaction's standard lock on its own XID.

If pg_dump is actually getting blocked, that will show as a row with
granted = false and pg_dump's PID.

regards, tom lane

Browse pgsql-general by date

  From Date Subject
Next Message vinita bansal 2005-07-19 16:45:15 RAMFS with Postgres
Previous Message Tom Lane 2005-07-19 16:26:03 Re: index row size exceeds btree maximum, 2713 -