forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitec7ffb8
committed
amcheck: fix multiple problems with TOAST pointer validation
First, don't perform database access while holding a buffer lock.When checking a heap, we can validate that TOAST pointers are sane byperforming a scan on the TOAST index and looking up the chunks thatcorrespond to each value ID that appears in a TOAST poiner in the maintable. But, to do that while holding a buffer lock at least riskscausing other backends to wait uninterruptibly, and probably can causeundetected and uninterruptible deadlocks. So, instead, make a list ofchecks to perform while holding the lock, and then perform the checksafter releasing it.Second, adjust things so that we don't try to follow TOAST pointersfor tuples that are already eligible to be pruned. The TOAST tuplesbecome eligible for pruning at the same time that the main tuple does,so trying to check them may lead to spurious reports of corruption,as observed in the buildfarm. The necessary infrastructure to decidewhether or not the tuple being checked is prunable was added bycommit3b6c125, but it wasn'tactually used for its intended purpose prior to this patch.Mark Dilger, adjusted by me to avoid a memory leak.Discussion:http://postgr.es/m/AC5479E4-6321-473D-AC92-5EC36299FBC2@enterprisedb.com1 parent5fd9dfa commitec7ffb8
File tree
2 files changed
+165
-72
lines changed- contrib/amcheck
- src/tools/pgindent
2 files changed
+165
-72
lines changed0 commit comments
Comments
(0)