diff options
author | Noah Misch <noah@leadboat.com> | 2020-08-15 10:15:53 -0700 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2020-08-15 10:15:56 -0700 |
commit | 30e68a2abb3890c3292ff0b2422a7ea04d62acdd (patch) | |
tree | f4abe39532c9db31c78114d94d6b08584e551e16 /doc/src | |
parent | 912fb290c5dd087ccc4b04c19692137bb786a9fd (diff) | |
download | postgresql-30e68a2abb3890c3292ff0b2422a7ea04d62acdd.tar.gz postgresql-30e68a2abb3890c3292ff0b2422a7ea04d62acdd.zip |
Prevent concurrent SimpleLruTruncate() for any given SLRU.
The SimpleLruTruncate() header comment states the new coding rule. To
achieve this, add locktype "frozenid" and two LWLocks. This closes a
rare opportunity for data loss, which manifested as "apparent
wraparound" or "could not access status of transaction" errors. Data
loss is more likely in pg_multixact, due to released branches' thin
margin between multiStopLimit and multiWrapLimit. If a user's physical
replication primary logged ": apparent wraparound" messages, the user
should rebuild standbys of that primary regardless of symptoms. At less
risk is a cluster having emitted "not accepting commands" errors or
"must be vacuumed" warnings at some point. One can test a cluster for
this data loss by running VACUUM FREEZE in every database. Back-patch
to 9.5 (all supported versions).
Discussion: https://postgr.es/m/20190218073103.GA1434723@rfd.leadboat.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/catalogs.sgml | 4 | ||||
-rw-r--r-- | doc/src/sgml/monitoring.sgml | 20 |
2 files changed, 21 insertions, 3 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 791c7476387..25478510f3a 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -9095,7 +9095,8 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l and general database objects (identified by class OID and object OID, in the same way as in <structname>pg_description</structname> or <structname>pg_depend</structname>). Also, the right to extend a - relation is represented as a separate lockable object. + relation is represented as a separate lockable object, as is the right to + update <structname>pg_database</structname>.<structfield>datfrozenxid</structfield>. Also, <quote>advisory</quote> locks can be taken on numbers that have user-defined meanings. </para> @@ -9121,6 +9122,7 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l Type of the lockable object: <literal>relation</literal>, <literal>extend</literal>, + <literal>frozenid</literal>, <literal>page</literal>, <literal>tuple</literal>, <literal>transactionid</literal>, diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 4e87de2236a..0de92cd1dd8 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -885,7 +885,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser <tbody> <row> - <entry morerows="64"><literal>LWLock</literal></entry> + <entry morerows="66"><literal>LWLock</literal></entry> <entry><literal>ShmemIndexLock</literal></entry> <entry>Waiting to find or allocate space in shared memory.</entry> </row> @@ -1080,6 +1080,16 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser the oldest transaction id available to it.</entry> </row> <row> + <entry><literal>WrapLimitsVacuumLock</literal></entry> + <entry>Waiting to update limits on transaction id and multixact + consumption.</entry> + </row> + <row> + <entry><literal>NotifyQueueTailLock</literal></entry> + <entry>Waiting to update limit on notification message + storage.</entry> + </row> + <row> <entry><literal>clog</literal></entry> <entry>Waiting for I/O on a clog (transaction status) buffer.</entry> </row> @@ -1169,7 +1179,7 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser counters during Parallel Hash plan execution.</entry> </row> <row> - <entry morerows="9"><literal>Lock</literal></entry> + <entry morerows="10"><literal>Lock</literal></entry> <entry><literal>relation</literal></entry> <entry>Waiting to acquire a lock on a relation.</entry> </row> @@ -1178,6 +1188,12 @@ postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: ser <entry>Waiting to extend a relation.</entry> </row> <row> + <entry><literal>frozenid</literal></entry> + <entry>Waiting to + update <structname>pg_database</structname>.<structfield>datfrozenxid</structfield> + and <structname>pg_database</structname>.<structfield>datminmxid</structfield>.</entry> + </row> + <row> <entry><literal>page</literal></entry> <entry>Waiting to acquire a lock on page of a relation.</entry> </row> |