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