postgresql/src/include/access
Alexander Korotkov e36e25275f Check for conflicting queries during replay of gistvacuumpage()
013ebc0a7b implements so-called GiST microvacuum.  That is gistgettuple() marks
index tuples as dead when kill_prior_tuple is set.  Later, when new tuple
insertion claims page space, those dead index tuples are physically deleted
from page.  When this deletion is replayed on standby, it might conflict with
read-only queries.  But 013ebc0a7b doesn't handle this.  That may lead to
disappearance of some tuples from read-only snapshots on standby.

This commit implements resolving of conflicts between replay of GiST microvacuum
and standby queries.  On the master we implement new WAL record type
XLOG_GIST_DELETE, which comprises necessary information.  On stable releases
we've to be tricky to keep WAL compatibility.  Information required for conflict
processing is just appended to data of XLOG_GIST_PAGE_UPDATE record.  So,
PostgreSQL version, which doesn't know about conflict processing, will just
ignore that.

Reported-by: Andres Freund
Diagnosed-by: Andres Freund
Discussion: https://postgr.es/m/20181212224524.scafnlyjindmrbe6%40alap3.anarazel.de
Author: Alexander Korotkov
Backpatch-through: 9.6
2018-12-21 02:33:48 +03:00
..
amapi.h Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
amvalidate.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
attnum.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
brin.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
brin_internal.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
brin_page.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
brin_pageops.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
brin_revmap.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
brin_tuple.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
brin_xlog.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
bufmask.h For wal_consistency_checking, mask page checksum as well as page LSN. 2017-09-22 14:33:18 -04:00
clog.h Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
commit_ts.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
genam.h Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
generic_xlog.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
gin.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
gin_private.h Rename rbtree.c functions to use "rbt" prefix not "rb" prefix. 2018-11-06 13:25:24 -05:00
ginblock.h Prevent GIN deleted pages from being reclaimed too early 2018-12-13 06:41:04 +03:00
ginxlog.h Prevent GIN deleted pages from being reclaimed too early 2018-12-13 06:41:04 +03:00
gist.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
gist_private.h Check for conflicting queries during replay of gistvacuumpage() 2018-12-21 02:33:48 +03:00
gistscan.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
gistxlog.h Split index xlog headers from other private index headers. 2017-02-14 15:37:59 -05:00
hash.h Fix the overrun in hash index metapage for smaller block sizes. 2018-09-06 10:19:51 +05:30
hash_xlog.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
heapam.h Fix logical decoding error when system table w/ toast is repeatedly rewritten. 2018-10-10 13:53:02 -07:00
heapam_xlog.h Perform a lot more sanity checks when freezing tuples. 2017-12-14 18:20:48 -08:00
hio.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
htup.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
htup_details.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
itup.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
multixact.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
nbtree.h Allow btree comparison functions to return INT_MIN. 2018-10-05 16:01:29 -04:00
nbtxlog.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
parallel.h Report an ERROR if a parallel worker fails to start properly. 2018-01-23 11:13:42 -05:00
printsimple.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
printtup.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
reloptions.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
relscan.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
rewriteheap.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
rmgr.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
rmgrlist.h hash: Support WAL consistency checking. 2017-03-14 14:58:56 -04:00
sdir.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
skey.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
slru.h Remove outdated comment 2017-06-30 14:43:05 -04:00
spgist.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
spgist_private.h Prevent query-lifespan memory leakage of SP-GiST traversal values. 2018-03-19 23:59:17 -04:00
spgxlog.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
stratnum.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
subtrans.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
sysattr.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
timeline.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
transam.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
tsmapi.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
tupconvert.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
tupdesc.h Backpatch introduction of TupleDescAttr(tupdesc, i). 2017-08-22 07:46:05 -07:00
tupmacs.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
tuptoaster.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
twophase.h Mark assorted variables PGDLLIMPORT. 2017-12-05 09:24:05 -05:00
twophase_rmgr.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
valid.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
visibilitymap.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
xact.h Propagate xactStartTimestamp and stmtStartTimestamp to parallel workers. 2018-10-06 12:00:10 -04:00
xlog.h Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
xlog_internal.h Fix comment. 2017-08-01 08:00:11 +09:00
xlogdefs.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
xloginsert.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
xlogreader.h Fix scenario where streaming standby gets stuck at a continuation record. 2018-05-05 01:35:09 +03:00
xlogrecord.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
xlogutils.h Post-PG 10 beta1 pgindent run 2017-05-17 16:31:56 -04:00