Fix hard to hit race condition in heapam's tuple locking code.

Andres Freund <andres@anarazel.de>

Commit: e7caacf733f3ee77a555aa715ab6fbf4434e6b52
Author: Andres Freund <andres@anarazel.de>
Date: 2016-08-05T03:07:16Z
Releases: 9.6.0
Fix hard to hit race condition in heapam's tuple locking code.

As mentioned in its commit message, eca0f1db left open a race condition,
where a page could be marked all-visible, after the code checked
PageIsAllVisible() to pin the VM, but before the page is locked.  Plug
that hole.

Reviewed-By: Robert Haas, Andres Freund
Author: Amit Kapila
Discussion: CAEepm=3fWAbWryVW9swHyLTY4sXVf0xbLvXqOwUoDiNCx9mBjQ@mail.gmail.com
Backpatch: -

Files

PathChange+/−
src/backend/access/heap/heapam.c modified +38 −6