Document AccessExclusive lock behaviour on standbys - Mailing list pgsql-hackers

From Anthonin Bonnefoy
Subject Document AccessExclusive lock behaviour on standbys
Date
Msg-id CAO6_XqqTY4hSF444P=w3cMu4x5mk0Y0-bkZz1askqj5BvY7FpQ@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hi,

When a table is locked with AccessExclusive locks, the table is also
locked on standbys as the lock is propagated through the WAL and
replayed by the recovery process. This seems to surprise users as they
assume the lock is restricted to the primary and don't expect the
table to be unreadable on standbys.

I usually point to some comments in lock.c to explain this behaviour
but showing C code is not the most user friendly. There are some
mentions about this scattered in the hot-standby documentation but
users are more likely going to look at the explicit locking
documentation.

The provided patch adds more details on this in the table-level locks
documentation, making it explicit that the tables will be locked on
standbys and for how long.

Regards,
Anthonin Bonnefoy

Attachment

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: pg_dump does not dump domain not-null constraint's comments
Next
From: Sutou Kouhei
Date:
Subject: Re: Make COPY format extendable: Extract COPY TO format implementations