pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedQuery on Postgres locks
7+ messages / 4 participants
[nested] [flat]
* Query on Postgres locks
@ 2015-09-24 09:34 Porwal, Utkarsh <utkarsh.porwal@emc.com>
0 siblings, 1 reply; 7+ messages in thread
From: Porwal, Utkarsh @ 2015-09-24 09:34 UTC (permalink / raw)
To: pgsql-admin
Dear All,
I have a perl script which will attempt to drop/recreate some intermediate tables. This works by trying to acquire an access exclusive lock on the intermediate tables.
When there is a backup running through pg_dump, I see an entry in pg_locks/pg_stat_activity table for the above which is waiting for pg_dump to finish, which is expected.
Since backup on huge environment takes around 8 hrs to complete, I noticed that the entries waiting for locks are removed after certain amount of time which I couldn’t record even though the perl script is still running.
Do you guys know if the lock waiting will ultimately timeout and when? I don’t have any statement_timeout specified.
Any pointers on this behavior?
Regards,
Utkarsh
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query on Postgres locks
@ 2015-09-24 09:37 Porwal, Utkarsh <utkarsh.porwal@emc.com>
parent: Porwal, Utkarsh <utkarsh.porwal@emc.com>
0 siblings, 1 reply; 7+ messages in thread
From: Porwal, Utkarsh @ 2015-09-24 09:37 UTC (permalink / raw)
To: Porwal, Utkarsh <utkarsh.porwal@emc.com>; pgsql-admin
The postgres version is –
psql (9.0.7)
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Porwal, Utkarsh
Sent: Thursday, September 24, 2015 3:04 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Query on Postgres locks
Dear All,
I have a perl script which will attempt to drop/recreate some intermediate tables. This works by trying to acquire an access exclusive lock on the intermediate tables.
When there is a backup running through pg_dump, I see an entry in pg_locks/pg_stat_activity table for the above which is waiting for pg_dump to finish, which is expected.
Since backup on huge environment takes around 8 hrs to complete, I noticed that the entries waiting for locks are removed after certain amount of time which I couldn’t record even though the perl script is still running.
Do you guys know if the lock waiting will ultimately timeout and when? I don’t have any statement_timeout specified.
Any pointers on this behavior?
Regards,
Utkarsh
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query on Postgres locks
@ 2015-09-24 10:19 Wei Shan <weishan.ang@gmail.com>
parent: Porwal, Utkarsh <utkarsh.porwal@emc.com>
0 siblings, 1 reply; 7+ messages in thread
From: Wei Shan @ 2015-09-24 10:19 UTC (permalink / raw)
To: Porwal, Utkarsh <utkarsh.porwal@emc.com>; +Cc: pgsql-admin
Hi,
If you look at pg_settings table, you can see the default value for
statement_timeout. Only from 9.3, there's a parameter called lock_timeout.
Cheers.
On 24 September 2015 at 17:37, Porwal, Utkarsh <utkarsh.porwal@emc.com>
wrote:
> The postgres version is –
>
>
>
> psql (9.0.7)
>
>
>
>
>
> *From:* pgsql-admin-owner@postgresql.org [mailto:
> pgsql-admin-owner@postgresql.org] *On Behalf Of *Porwal, Utkarsh
> *Sent:* Thursday, September 24, 2015 3:04 PM
> *To:* pgsql-admin@postgresql.org
> *Subject:* [ADMIN] Query on Postgres locks
>
>
>
> Dear All,
>
>
>
> I have a perl script which will attempt to drop/recreate some intermediate
> tables. This works by trying to acquire an access exclusive lock on the
> intermediate tables.
>
>
>
> When there is a backup running through pg_dump, I see an entry in
> pg_locks/pg_stat_activity table for the above which is waiting for pg_dump
> to finish, which is expected.
>
>
>
> Since backup on huge environment takes around 8 hrs to complete, I noticed
> that the entries waiting for locks are removed after certain amount of time
> which I couldn’t record even though the perl script is still running.
>
> Do you guys know if the lock waiting will ultimately timeout and when? I
> don’t have any statement_timeout specified.
>
>
>
> Any pointers on this behavior?
>
>
>
> Regards,
>
> Utkarsh
>
--
Regards,
Ang Wei Shan
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query on Postgres locks
@ 2015-09-24 10:36 Porwal, Utkarsh <utkarsh.porwal@emc.com>
parent: Wei Shan <weishan.ang@gmail.com>
0 siblings, 1 reply; 7+ messages in thread
From: Porwal, Utkarsh @ 2015-09-24 10:36 UTC (permalink / raw)
To: Wei Shan <weishan.ang@gmail.com>; +Cc: pgsql-admin
Hi Wei shan,
For me the statement_timeout is defaulted to zero
statement_timeout | 0 | ms
Thanks and Regards,
Utkarsh Porwal
From: Wei Shan [mailto:weishan.ang@gmail.com]
Sent: Thursday, September 24, 2015 3:49 PM
To: Porwal, Utkarsh
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Query on Postgres locks
Hi,
If you look at pg_settings table, you can see the default value for statement_timeout. Only from 9.3, there's a parameter called lock_timeout.
Cheers.
On 24 September 2015 at 17:37, Porwal, Utkarsh <utkarsh.porwal@emc.com<mailto:utkarsh.porwal@emc.com>> wrote:
The postgres version is –
psql (9.0.7)
From: pgsql-admin-owner@postgresql.org<mailto:pgsql-admin-owner@postgresql.org> [mailto:pgsql-admin-owner@postgresql.org<mailto:pgsql-admin-owner@postgresql.org>] On Behalf Of Porwal, Utkarsh
Sent: Thursday, September 24, 2015 3:04 PM
To: pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>
Subject: [ADMIN] Query on Postgres locks
Dear All,
I have a perl script which will attempt to drop/recreate some intermediate tables. This works by trying to acquire an access exclusive lock on the intermediate tables.
When there is a backup running through pg_dump, I see an entry in pg_locks/pg_stat_activity table for the above which is waiting for pg_dump to finish, which is expected.
Since backup on huge environment takes around 8 hrs to complete, I noticed that the entries waiting for locks are removed after certain amount of time which I couldn’t record even though the perl script is still running.
Do you guys know if the lock waiting will ultimately timeout and when? I don’t have any statement_timeout specified.
Any pointers on this behavior?
Regards,
Utkarsh
--
Regards,
Ang Wei Shan
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query on Postgres locks
@ 2015-09-24 14:59 Jan Harasym <jan.harasym@massive.se>
parent: Porwal, Utkarsh <utkarsh.porwal@emc.com>
0 siblings, 1 reply; 7+ messages in thread
From: Jan Harasym @ 2015-09-24 14:59 UTC (permalink / raw)
To: Porwal, Utkarsh <utkarsh.porwal@emc.com>; Wei Shan <weishan.ang@gmail.com>; +Cc: pgsql-admin
For many things “0” is “disabled”
So there is no timeout, it will wait forever.
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Porwal, Utkarsh
Sent: September 24, 2015 12:37 PM
To: Wei Shan
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Query on Postgres locks
Hi Wei shan,
For me the statement_timeout is defaulted to zero
statement_timeout | 0 | ms
Thanks and Regards,
Utkarsh Porwal
From: Wei Shan [mailto:weishan.ang@gmail.com]
Sent: Thursday, September 24, 2015 3:49 PM
To: Porwal, Utkarsh
Cc: pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>
Subject: Re: [ADMIN] Query on Postgres locks
Hi,
If you look at pg_settings table, you can see the default value for statement_timeout. Only from 9.3, there's a parameter called lock_timeout.
Cheers.
On 24 September 2015 at 17:37, Porwal, Utkarsh <utkarsh.porwal@emc.com<mailto:utkarsh.porwal@emc.com>> wrote:
The postgres version is –
psql (9.0.7)
From: pgsql-admin-owner@postgresql.org<mailto:pgsql-admin-owner@postgresql.org> [mailto:pgsql-admin-owner@postgresql.org<mailto:pgsql-admin-owner@postgresql.org>] On Behalf Of Porwal, Utkarsh
Sent: Thursday, September 24, 2015 3:04 PM
To: pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>
Subject: [ADMIN] Query on Postgres locks
Dear All,
I have a perl script which will attempt to drop/recreate some intermediate tables. This works by trying to acquire an access exclusive lock on the intermediate tables.
When there is a backup running through pg_dump, I see an entry in pg_locks/pg_stat_activity table for the above which is waiting for pg_dump to finish, which is expected.
Since backup on huge environment takes around 8 hrs to complete, I noticed that the entries waiting for locks are removed after certain amount of time which I couldn’t record even though the perl script is still running.
Do you guys know if the lock waiting will ultimately timeout and when? I don’t have any statement_timeout specified.
Any pointers on this behavior?
Regards,
Utkarsh
--
Regards,
Ang Wei Shan
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query on Postgres locks
@ 2015-09-24 15:33 Porwal, Utkarsh <utkarsh.porwal@emc.com>
parent: Jan Harasym <jan.harasym@massive.se>
0 siblings, 1 reply; 7+ messages in thread
From: Porwal, Utkarsh @ 2015-09-24 15:33 UTC (permalink / raw)
To: weishan.ang@gmail.com <weishan.ang@gmail.com>; jan.harasym@massive.se <jan.harasym@massive.se>; +Cc: pgsql-admin
Yes and hence my original question- why would the queries and the locks waiting to be granted disappear when there is no timeout?
Sent from my Android phone using Symantec TouchDown (www.symantec.com)
-----Original Message-----
From: Jan Harasym [jan.harasym@massive.se]
Received: Thursday, 24 Sep 2015, 20:31
To: Porwal, Utkarsh [utkarsh.porwal@emc.com]; Wei Shan [weishan.ang@gmail.com]
CC: pgsql-admin@postgresql.org [pgsql-admin@postgresql.org]
Subject: RE: [ADMIN] Query on Postgres locks
For many things “0” is “disabled”
So there is no timeout, it will wait forever.
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Porwal, Utkarsh
Sent: September 24, 2015 12:37 PM
To: Wei Shan
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Query on Postgres locks
Hi Wei shan,
For me the statement_timeout is defaulted to zero
statement_timeout | 0 | ms
Thanks and Regards,
Utkarsh Porwal
From: Wei Shan [mailto:weishan.ang@gmail.com]
Sent: Thursday, September 24, 2015 3:49 PM
To: Porwal, Utkarsh
Cc: pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>
Subject: Re: [ADMIN] Query on Postgres locks
Hi,
If you look at pg_settings table, you can see the default value for statement_timeout. Only from 9.3, there's a parameter called lock_timeout.
Cheers.
On 24 September 2015 at 17:37, Porwal, Utkarsh <utkarsh.porwal@emc.com<mailto:utkarsh.porwal@emc.com>> wrote:
The postgres version is –
psql (9.0.7)
From: pgsql-admin-owner@postgresql.org<mailto:pgsql-admin-owner@postgresql.org> [mailto:pgsql-admin-owner@postgresql.org<mailto:pgsql-admin-owner@postgresql.org>] On Behalf Of Porwal, Utkarsh
Sent: Thursday, September 24, 2015 3:04 PM
To: pgsql-admin@postgresql.org<mailto:pgsql-admin@postgresql.org>
Subject: [ADMIN] Query on Postgres locks
Dear All,
I have a perl script which will attempt to drop/recreate some intermediate tables. This works by trying to acquire an access exclusive lock on the intermediate tables.
When there is a backup running through pg_dump, I see an entry in pg_locks/pg_stat_activity table for the above which is waiting for pg_dump to finish, which is expected.
Since backup on huge environment takes around 8 hrs to complete, I noticed that the entries waiting for locks are removed after certain amount of time which I couldn’t record even though the perl script is still running.
Do you guys know if the lock waiting will ultimately timeout and when? I don’t have any statement_timeout specified.
Any pointers on this behavior?
Regards,
Utkarsh
--
Regards,
Ang Wei Shan
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Query on Postgres locks
@ 2015-09-24 20:25 Scott Mead <scottm@openscg.com>
parent: Porwal, Utkarsh <utkarsh.porwal@emc.com>
0 siblings, 0 replies; 7+ messages in thread
From: Scott Mead @ 2015-09-24 20:25 UTC (permalink / raw)
To: Porwal, Utkarsh <utkarsh.porwal@emc.com>; +Cc: weishan.ang@gmail.com <weishan.ang@gmail.com>; jan.harasym@massive.se <jan.harasym@massive.se>; pgsql-admin
On Thu, Sep 24, 2015 at 11:33 AM, Porwal, Utkarsh <utkarsh.porwal@emc.com>
wrote:
> Yes and hence my original question- why would the queries and the locks
> waiting to be granted disappear when there is no timeout?
>
> Do you have a timeout set in DBI ?
--Scott
> Sent from my Android phone using Symantec TouchDown (www.symantec.com)
>
>
> -----Original Message-----
> *From:* Jan Harasym [jan.harasym@massive.se]
> *Received:* Thursday, 24 Sep 2015, 20:31
> *To:* Porwal, Utkarsh [utkarsh.porwal@emc.com]; Wei Shan [
> weishan.ang@gmail.com]
> *CC:* pgsql-admin@postgresql.org [pgsql-admin@postgresql.org]
> *Subject:* RE: [ADMIN] Query on Postgres locks
>
> For many things “0” is “disabled”
>
>
>
> So there is no timeout, it will wait forever.
>
>
>
> *From:* pgsql-admin-owner@postgresql.org [mailto:
> pgsql-admin-owner@postgresql.org] *On Behalf Of *Porwal, Utkarsh
> *Sent:* September 24, 2015 12:37 PM
> *To:* Wei Shan
> *Cc:* pgsql-admin@postgresql.org
> *Subject:* Re: [ADMIN] Query on Postgres locks
>
>
>
> Hi Wei shan,
>
>
>
> For me the statement_timeout is defaulted to zero
>
>
>
> statement_timeout | 0
> | ms
>
>
>
> *Thanks and Regards,*
>
> *Utkarsh Porwal*
>
>
>
>
>
> *From:* Wei Shan [mailto:weishan.ang@gmail.com <weishan.ang@gmail.com>]
> *Sent:* Thursday, September 24, 2015 3:49 PM
> *To:* Porwal, Utkarsh
> *Cc:* pgsql-admin@postgresql.org
> *Subject:* Re: [ADMIN] Query on Postgres locks
>
>
>
> Hi,
>
>
>
> If you look at pg_settings table, you can see the default value for
> statement_timeout. Only from 9.3, there's a parameter called lock_timeout.
>
>
>
> Cheers.
>
>
>
> On 24 September 2015 at 17:37, Porwal, Utkarsh <utkarsh.porwal@emc.com>
> wrote:
>
> The postgres version is –
>
>
>
> psql (9.0.7)
>
>
>
>
>
> *From:* pgsql-admin-owner@postgresql.org [mailto:
> pgsql-admin-owner@postgresql.org] *On Behalf Of *Porwal, Utkarsh
> *Sent:* Thursday, September 24, 2015 3:04 PM
> *To:* pgsql-admin@postgresql.org
> *Subject:* [ADMIN] Query on Postgres locks
>
>
>
> Dear All,
>
>
>
> I have a perl script which will attempt to drop/recreate some intermediate
> tables. This works by trying to acquire an access exclusive lock on the
> intermediate tables.
>
>
>
> When there is a backup running through pg_dump, I see an entry in
> pg_locks/pg_stat_activity table for the above which is waiting for pg_dump
> to finish, which is expected.
>
>
>
> Since backup on huge environment takes around 8 hrs to complete, I noticed
> that the entries waiting for locks are removed after certain amount of time
> which I couldn’t record even though the perl script is still running.
>
> Do you guys know if the lock waiting will ultimately timeout and when? I
> don’t have any statement_timeout specified.
>
>
>
> Any pointers on this behavior?
>
>
>
> Regards,
>
> Utkarsh
>
>
>
>
>
> --
>
> Regards,
> Ang Wei Shan
>
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2015-09-24 20:25 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-09-24 09:34 Query on Postgres locks Porwal, Utkarsh <utkarsh.porwal@emc.com>
2015-09-24 09:37 ` Porwal, Utkarsh <utkarsh.porwal@emc.com>
2015-09-24 10:19 ` Wei Shan <weishan.ang@gmail.com>
2015-09-24 10:36 ` Porwal, Utkarsh <utkarsh.porwal@emc.com>
2015-09-24 14:59 ` Jan Harasym <jan.harasym@massive.se>
2015-09-24 15:33 ` Porwal, Utkarsh <utkarsh.porwal@emc.com>
2015-09-24 20:25 ` Scott Mead <scottm@openscg.com>
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