postgresql/src/backend/commands
Heikki Linnakangas 2a8e1ac598 Set the all-visible flag on heap page before writing WAL record, not after.
If we set the all-visible flag after writing WAL record, and XLogInsert
takes a full-page image of the page, the image would not include the flag.
We will then proceed to set the VM bit, which would then be set without the
corresponding all-visible flag on the heap page.

Found by comparing page images on master and standby, after writing/replaying
each WAL record. (There is still a discrepancy: the all-visible flag won't
be set after replaying the HEAP_CLEAN record, even though it is set in the
master. However, it will be set when replaying the HEAP2_VISIBLE record and
setting the VM bit, so the all-visible flag and VM bit are always consistent
on the standby, even though they are momentarily out-of-sync with master)

Backpatch to 9.3 where this code was introduced.
2014-04-17 17:47:50 +03:00
..
aggregatecmds.c Create infrastructure for moving-aggregate optimization. 2014-04-12 12:03:30 -04:00
alter.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
analyze.c Introduce logical decoding. 2014-03-03 16:32:18 -05:00
async.c Avoid transaction-commit race condition while receiving a NOTIFY message. 2014-03-13 12:02:54 -04:00
cluster.c Reduce lock levels of some ALTER TABLE cmds 2014-04-06 11:13:43 -04:00
collationcmds.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
comment.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
constraint.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
conversioncmds.c Make various variables const (read-only). 2014-01-18 16:04:32 -05:00
copy.c Provide a FORCE NULL option to COPY in CSV mode. 2014-03-04 17:31:59 -05:00
createas.c Reduce lock levels of some ALTER TABLE cmds 2014-04-06 11:13:43 -04:00
dbcommands.c Introduce logical decoding. 2014-03-03 16:32:18 -05:00
define.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
discard.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
dropcmds.c Make DROP IF EXISTS more consistently not fail 2014-01-23 14:40:29 -03:00
event_trigger.c Mark some more variables as static or include the appropriate header 2014-02-08 21:21:46 -05:00
explain.c Rename EXPLAIN ANALYZE's "total runtime" output to "execution time". 2014-04-16 20:48:59 -04:00
extension.c Prefer pg_any_to_server/pg_server_to_any over pg_do_encoding_conversion. 2014-02-23 16:59:05 -05:00
foreigncmds.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
functioncmds.c Prevent privilege escalation in explicit calls to PL validators. 2014-02-17 09:33:31 -05:00
indexcmds.c Avoid repeated name lookups during table and index DDL. 2014-02-17 09:33:31 -05:00
lockcmds.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
Makefile Add a materialized view relations. 2013-03-03 18:23:31 -06:00
matview.c Fix relcache reference leak in refresh_by_match_merge(). 2014-03-18 11:36:53 -04:00
opclasscmds.c Make DROP IF EXISTS more consistently not fail 2014-01-23 14:40:29 -03:00
operatorcmds.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
portalcmds.c Improve some O(N^2) behavior in window function evaluation. 2014-04-13 13:59:17 -04:00
prepare.c Include planning time in EXPLAIN ANALYZE output. 2014-01-29 16:09:15 -05:00
proclang.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
schemacmds.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
seclabel.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
sequence.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
tablecmds.c Make security barrier views automatically updatable 2014-04-12 21:04:58 -04:00
tablespace.c Fix tablespace creation WAL replay to work on Windows. 2014-04-04 23:09:35 -04:00
trigger.c Offer triggers on foreign tables. 2014-03-23 02:16:34 -04:00
tsearchcmds.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
typecmds.c Make DROP IF EXISTS more consistently not fail 2014-01-23 14:40:29 -03:00
user.c Shore up ADMIN OPTION restrictions. 2014-02-17 09:33:31 -05:00
vacuum.c Introduce logical decoding. 2014-03-03 16:32:18 -05:00
vacuumlazy.c Set the all-visible flag on heap page before writing WAL record, not after. 2014-04-17 17:47:50 +03:00
variable.c Update copyright for 2014 2014-01-07 16:05:30 -05:00
view.c Make security barrier views automatically updatable 2014-04-12 21:04:58 -04:00