aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2020-07-19 16:12:51 -0700
committerPeter Geoghegan <pg@bowt.ie>2020-07-19 16:12:51 -0700
commita766d6ca22ac7c233e69c896ae0c5f19de916db4 (patch)
tree0db2574ec7cbfe402785294a80d3b4a8fdd1300c /src
parent46ef520b9566d9eccb095ceafa53e5c305cf80b9 (diff)
downloadpostgresql-a766d6ca22ac7c233e69c896ae0c5f19de916db4.tar.gz
postgresql-a766d6ca22ac7c233e69c896ae0c5f19de916db4.zip
Avoid harmless Valgrind no-buffer-pin errors.
Valgrind builds with assertions enabled sometimes perform a theoretically unsafe page access inside an assertion in heapam_tuple_lock(). This happened when the eval-plan-qual isolation test ran one of the permutations added by commit a2418f9e238. Avoid complaints from Valgrind by moving the assertion ever so slightly. This is minor cleanup for commit 1e0dfd16, which added Valgrind buffer access instrumentation. No backpatch, since this only happens within an assertion, and seems very unlikely to cause any real problems even with assert-enabled builds.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/heap/heapam_handler.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c
index 56b35622f1a..8f2e5379210 100644
--- a/src/backend/access/heap/heapam_handler.c
+++ b/src/backend/access/heap/heapam_handler.c
@@ -368,10 +368,11 @@ tuple_lock_retry:
if (result == TM_Updated &&
(flags & TUPLE_LOCK_FLAG_FIND_LAST_VERSION))
{
- ReleaseBuffer(buffer);
/* Should not encounter speculative tuple on recheck */
Assert(!HeapTupleHeaderIsSpeculative(tuple->t_data));
+ ReleaseBuffer(buffer);
+
if (!ItemPointerEquals(&tmfd->ctid, &tuple->t_self))
{
SnapshotData SnapshotDirty;