postgresql/src/backend
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
..
access Fix race condition between relation extension and vacuum. 2019-01-28 15:44:12 -08:00
bootstrap Remove argument isprimary from index_build() 2019-01-24 07:57:09 +09:00
catalog Fix droppability of constraints upon partition detach 2019-01-24 14:09:56 -03:00
commands Separate per-batch and per-tuple memory contexts in COPY 2019-01-29 00:00:47 +01:00
executor In the planner, replace an empty FROM clause with a dummy RTE. 2019-01-28 17:54:23 -05:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
lib Update copyright for 2019 2019-01-02 12:44:25 -05:00
libpq Update copyright for 2019 2019-01-02 12:44:25 -05:00
main Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
nodes In the planner, replace an empty FROM clause with a dummy RTE. 2019-01-28 17:54:23 -05:00
optimizer In the planner, replace an empty FROM clause with a dummy RTE. 2019-01-28 17:54:23 -05:00
parser In the planner, replace an empty FROM clause with a dummy RTE. 2019-01-28 17:54:23 -05:00
partitioning Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
po Translation updates 2018-06-25 12:37:18 +02:00
port Update copyright for 2019 2019-01-02 12:44:25 -05:00
postmaster Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
regex Update copyright for 2019 2019-01-02 12:44:25 -05:00
replication Move remaining code from tqual.[ch] to heapam.h / heapam_visibility.c. 2019-01-21 17:07:10 -08:00
rewrite Split QTW_EXAMINE_RTES flag into QTW_EXAMINE_RTES_BEFORE/_AFTER. 2019-01-25 17:09:45 -05:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Replace uses of heap_open et al with the corresponding table_* function. 2019-01-21 10:51:37 -08:00
storage Revert "Avoid creation of the free space map for small heap relations." 2019-01-28 11:31:44 +05:30
tcop Change function call information to be variable length. 2019-01-26 14:17:52 -08:00
tsearch Update copyright for 2019 2019-01-02 12:44:25 -05:00
utils In the planner, replace an empty FROM clause with a dummy RTE. 2019-01-28 17:54:23 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Ensure link commands list *.o files before LDFLAGS. 2019-01-02 13:57:54 -05:00
nls.mk Translation updates 2018-06-25 12:37:18 +02:00