Re: What Causes Access Exclusive Lock?

Поиск
Список
Период
Сортировка
От Sameer Kumar
Тема Re: What Causes Access Exclusive Lock?
Дата
Msg-id CADp-Sm5Je68JTvsyG8WHqzfEH8A0A_jm1s59D-8gXPgDJEOmMA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: What Causes Access Exclusive Lock?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general


On Thu, Jun 23, 2016 at 11:57 PM Adrian Klaver <adrian.klaver@aklaver.com> wrote:
On 06/23/2016 08:14 AM, Sameer Kumar wrote:
>
> Hi,
>
> I just wanted to understand what are the commands which will acquire
> Access Exclusive Lock on a table? In my knowledge below operations will
> acquire access exclusive lock:-
>
> 1. VACUUM FULL
> 2. ALTER TABLE
> 3. DROP TABLE
> 4. TRUNCATE
> 5. REINDEX
> 6. LOCK command with Access Exclusive Mode (or no mode specified)
>
> I am using PostgreSQL v9.4.

https://www.postgresql.org/docs/9.4/static/explicit-locking.html

ACCESS EXCLUSIVE

Thanks!
I had checked that and arrived at the list above.

Why I wanted to confirm because, I am facing a situation similar (or rather same) as what is described in two threads below-



pg_stat_database_conflicts.confl_lock is *non-zero* and connections on standby (idle in transaction or executing SELECT) are disconnected. 

I *do not* see the message -
"User query might have needed to see row versions that must be removed."

But I see disconnection on standby because of a "relation lock" being held for long.

From what I understood that if there is a LOCK conflict on standby (between a session an a WAL replay), it might cause even cause disconnection of an "idle in transaction" session (which is causing conflict on standby). Is this right?

My understanding is only Access Exclusive Locks will cause conflicts against a read-only query. Is that right? 

So I checked and confirmed that there is no such operation on master which would result in Access Exclusive lock.

I am using v9.4.4. Is there a bug which is hitting me or is there any other kind of query which might cause lock conflict on standby?

The threads above seem to have same issue, but I did not see any conclusive reason explained in the hacker or admin thread.

>
>
>
> Regards
> Sameer
> --
> --
> Best Regards
> Sameer Kumar | DB Solution Architect
> *ASHNIK PTE. LTD.*
>
> 101 Cecil Street, #11-11 Tong Eng Building, Singapore 069 533
>
> T: +65 6438 3504 | M: +65 8110 0350 | www.ashnik.com
>


--
Adrian Klaver
adrian.klaver@aklaver.com
--
--
Best Regards
Sameer Kumar | DB Solution Architect 
ASHNIK PTE. LTD.

101 Cecil Street, #11-11 Tong Eng Building, Singapore 069 533

T: +65 6438 3504 | M: +65 8110 0350 | www.ashnik.com

В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: What Causes Access Exclusive Lock?
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: What Causes Access Exclusive Lock?