https://github.com/postgres/postgres
Revision eca0f1db14ac92d91d54eca8eeff2d15ccd797fa authored by Andres Freund on 18 July 2016, 09:01:13 UTC, committed by Andres Freund on 18 July 2016, 09:01:13 UTC
Since a892234 & fd31cd265 the visibilitymap's freeze bit is used to
avoid vacuuming the whole relation in anti-wraparound vacuums. Doing so
correctly relies on not adding xids to the heap without also unsetting
the visibilitymap flag.  Tuple locking related code has not done so.

To allow selectively resetting all-frozen - to avoid pessimizing
heap_lock_tuple - allow to selectively reset the all-frozen with
visibilitymap_clear(). To avoid having to use
visibilitymap_get_status (e.g. via VM_ALL_FROZEN) inside a critical
section, have visibilitymap_clear() return whether any bits have been
reset.

There's a remaining issue (denoted by XXX): After the PageIsAllVisible()
check in heap_lock_tuple() and heap_lock_updated_tuple_rec() the page
status could theoretically change. Practically that currently seems
impossible, because updaters will hold a page level pin already.  Due to
the next beta coming up, it seems better to get the required WAL magic
bump done before resolving this issue.

The added flags field fields to xl_heap_lock and xl_heap_lock_updated
require bumping the WAL magic. Since there's already been a catversion
bump since the last beta, that's not an issue.

Reviewed-By: Robert Haas, Amit Kapila and Andres Freund
Author: Masahiko Sawada, heavily revised by Andres Freund
Discussion: CAEepm=3fWAbWryVW9swHyLTY4sXVf0xbLvXqOwUoDiNCx9mBjQ@mail.gmail.com
Backpatch: -
1 parent 6563208
History
Tip revision: eca0f1db14ac92d91d54eca8eeff2d15ccd797fa authored by Andres Freund on 18 July 2016, 09:01:13 UTC
Clear all-frozen visibilitymap status when locking tuples.
Tip revision: eca0f1d
File Mode Size
config
contrib
doc
src
.dir-locals.el -rw-r--r-- 738 bytes
.gitattributes -rw-r--r-- 1.7 KB
.gitignore -rw-r--r-- 434 bytes
COPYRIGHT -rw-r--r-- 1.2 KB
GNUmakefile.in -rw-r--r-- 3.6 KB
HISTORY -rw-r--r-- 283 bytes
Makefile -rw-r--r-- 1.5 KB
README -rw-r--r-- 1.2 KB
README.git -rw-r--r-- 727 bytes
aclocal.m4 -rw-r--r-- 384 bytes
configure -rwxr-xr-x 459.3 KB
configure.in -rw-r--r-- 72.9 KB

README

back to top