locks held during commit with synchronous replication - Mailing list pgsql-general

From Torsten Förtsch
Subject locks held during commit with synchronous replication
Date
Msg-id 5265586E.10800@gmx.net
Whole thread Raw
Responses Re: locks held during commit with synchronous replication
List pgsql-general
Hi,

I noticed that with synchronous replication I often see locks like this:

-[ RECORD 10 ]-----+--------------------
locktype           | object
database           | 0
relation           |
page               |
tuple              |
virtualxid         |
transactionid      |
classid            | 1262
objid              | 0
objsubid           | 0
virtualtransaction | 13/42806
pid                | 9794
mode               | AccessExclusiveLock
granted            | t
fastpath           | f

According to the manual classid is an oid in pg_class. If so, the 1262
resolves to pg_database. What objid=0 means, I have no idea.

For how long is this lock held?

Am I right in assuming that it is held from the start of the commit
until the transaction is streamed and written to disk by the synchronous
replica?

Does that mean that only one transaction can be committed at a time? I
have to admit I haven't thought much about that before. Lock contention
has never been a problem here.

Thanks,
Torsten


pgsql-general by date:

Previous
From: Stephen Frost
Date:
Subject: Re: pg_dump resulting in excessive memory use by postmaster process
Next
From: Moshe Jacobson
Date:
Subject: Re: Bug? Function with side effects not evaluated in CTE