From: | Noah Misch <noah(at)leadboat(dot)com> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Prevent concurrent SimpleLruTruncate() for any given SLRU. |
Date: | 2020-08-15 17:20:15 |
Message-ID: | E1k6zqp-0008VI-0g@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
Branch
------
REL9_5_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/3fbbf64ceecbd0fe675850070ea1e5d77c401c4f
Modified Files
--------------
doc/src/sgml/catalogs.sgml | 4 +++-
src/backend/access/transam/slru.c | 8 ++++++++
src/backend/access/transam/subtrans.c | 4 ++--
src/backend/commands/async.c | 37 +++++++++++++++++++++++++----------
src/backend/commands/vacuum.c | 13 ++++++++++++
src/backend/storage/lmgr/lmgr.c | 20 +++++++++++++++++++
src/backend/utils/adt/lockfuncs.c | 12 ++++++++++++
src/include/storage/lmgr.h | 3 +++
src/include/storage/lock.h | 10 ++++++++++
src/include/storage/lwlock.h | 4 +++-
10 files changed, 101 insertions(+), 14 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2020-08-15 19:44:49 | pgsql: Doc: various improvements for pg_basebackup reference page. |
Previous Message | Noah Misch | 2020-08-15 17:20:14 | pgsql: Prevent concurrent SimpleLruTruncate() for any given SLRU. |