Re: VACUUM FULL hangs on ordinary table

From: "Ivan Zolotukhin" <ivan(dot)zolotukhin(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Joachim Wieland" <joe(at)mcknight(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: VACUUM FULL hangs on ordinary table
Date: 2006-05-20 12:38:37
Message-ID: 751e56400605200538x4e7959e8p650e97c0b2e464f2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/19/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "Ivan Zolotukhin" <ivan(dot)zolotukhin(at)gmail(dot)com> writes:
> > quite ordinary I think. When it hangs I see in `ps auxww` process with
> > "VACUUM waiting" in its status.
>
> It's definitely waiting for a lock then.

Yep, I checked that it waits for acquiring AccessExclusiveLock on the
next table to vacuum after it finished "education" table.

>
> > Below I pasted last lines concerning above table from VACUUM output
> > (it stops after the last line):
> > ...
> > INFO: analyzing "public.education"
> > INFO: "education": scanned 674 of 674 pages, containing 40653 live
> > rows and 1111 dead rows; 3000 rows in sample, 40653 estimated total
> > rows
>
> If it hangs there then I'd venture that it's trying to get writer's
> lock (RowExclusiveLock) on pg_statistic so it can store the new
> statistic rows. Or possibly pg_class. You should be looking for locks
> on the system catalogs not locks on "education" itself.

Actually, Joachim was closer to the truth: there was one not committed
prepared transaction started several days ago (client disconnected at
the beginning) that holded one RowExclusiveLock and 12
AccessShareLocks on several relations in that DB (that obviously
interfered with vacuum trying to acquire AccessExclusiveLock on one of
them). After ROLLBACK PREPARED vacuum works fine so thanks to your
advices -- they helped me to solve the problem.

Regards,
Ivan Zolotukhin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message kmh496 2006-05-20 14:37:35 Re: another seemingly simple encoding question
Previous Message Tomi NA 2006-05-20 09:46:25 Re: ALTER SEQUENCE ... RESTART WITH [variable] problem