Deadlock of REINDEX and SELECT queries in PostgresSQL 7.4

From: "Tendulker, Shivanand G Prabhu (SSTL)" <shivanand(dot)tendulker(at)hp(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Cc: "M(dot)G(dot), Rashmi (STSD)" <rashmi(dot)m-g(at)hp(dot)com>, "Tyagi, Parul" <parul(dot)tyagi(at)hp(dot)com>
Subject: Deadlock of REINDEX and SELECT queries in PostgresSQL 7.4
Date: 2011-09-29 15:49:07
Message-ID: F33134F59C8F814ABE60F2E1C62BD5B29BE2FF@G4W3208.americas.hpqcorp.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

We are facing a deadlock kind of issue in PostgresSQL 7.4

We have 2 databases with 3 tables each. DB contains about 250 records. We observed deadlock when 2 different clients are performing REINDEX and SELECT start their operations near simultaneously.

Client 1 performs following operations in a tight loop:-
VACCUM, ANALYZE of each table, REINDEX of each table'

Client 2 performs SELECT in one of the table in a tight loop.

Upon looking at the postgres locks, it seems like all the locks are granted to 'REINDEX' operation and SELECT is waiting. REINDEX never returns in this scenario. This problem occurs when Client1 and Client 2 are running simultaneously. Both in a tight loop. Once this deadlock is reached all the subsequent SELECT, RENDEX operations go into 'waiting' mode.

Is this a known issue? Is the REINDEX and SELECT transactions directed at postgres at same time not a valid combination?

Please provide help in resolving this issue.

Thanks and Regards
Shiv

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David North 2011-09-29 15:51:02 Re: bytea columns and large values
Previous Message Marti Raudsepp 2011-09-29 15:27:25 Re: bytea columns and large values