postgresql/src
Andres Freund fc02e6724f Fix race condition between relation extension and vacuum.
In e6799d5a53 I removed vacuumlazy.c trickery around re-checking
whether a page is actually empty after acquiring an extension lock on
the relation, because the page is not PageInit()ed anymore, and
entries in the FSM ought not to lead to user-visible errors.

As reported by various buildfarm animals that is not correct, given
the way to code currently stands: If vacuum processes a page that's
just been newly added by either RelationGetBufferForTuple() or
RelationAddExtraBlocks(), it could add that page to the FSM and it
could be reused by other backends, before those two functions check
whether the newly added page is actually new.  That's a relatively
narrow race, but several buildfarm machines appear to be able to hit
it.

While it seems wrong that the FSM, given it's lack of durability and
approximative nature, can trigger errors like this, that seems better
fixed in a separate commit. Especially given that a good portion of
the buildfarm is red, and this is just re-introducing logic that
existed a few hours ago.

Author: Andres Freund
Discussion: https://postgr.es/m/20190128222259.zhi7ovzgtkft6em6@alap3.anarazel.de
2019-01-28 15:44:12 -08:00
..
backend Fix race condition between relation extension and vacuum. 2019-01-28 15:44:12 -08:00
bin psql: Remove unused tab completion query 2019-01-28 22:02:45 +01:00
common Use perfect hashing, instead of binary search, for keyword lookup. 2019-01-09 19:47:46 -05:00
fe_utils pgbench: add \cset and \gset commands 2019-01-10 13:42:20 -03:00
include In the planner, replace an empty FROM clause with a dummy RTE. 2019-01-28 17:54:23 -05:00
interfaces Remove _configthreadlocale() calls in ecpg test suite. 2019-01-24 17:02:09 -05:00
makefiles Ensure link commands list *.o files before LDFLAGS. 2019-01-02 13:57:54 -05:00
pl Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
port Use our own getopt() on OpenBSD. 2019-01-18 15:06:26 -05:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test In the planner, replace an empty FROM clause with a dummy RTE. 2019-01-28 17:54:23 -05:00
timezone Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
tools Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
tutorial SQL comment: remove extra word in heading comment 2019-01-25 18:57:21 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in fix typo 2019-01-13 16:43:14 -05:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00