]> granicus.if.org Git - postgresql/commit
Emit invalidations to standby for transactions without xid.
authorAndres Freund <andres@anarazel.de>
Sun, 24 Apr 2016 02:18:00 +0000 (19:18 -0700)
committerAndres Freund <andres@anarazel.de>
Wed, 27 Apr 2016 03:21:54 +0000 (20:21 -0700)
commitc6ff84b06a68b71719aa1aaa5f6704d8db1b51f8
treebca1d7f785aa03f73b137f3182d028e16abdf519
parent2ac3be2e763d9b971352819f285dd51519e0aeb9
Emit invalidations to standby for transactions without xid.

So far, when a transaction with pending invalidations, but without an
assigned xid, committed, we simply ignored those invalidation
messages. That's problematic, because those are actually sent for a
reason.

Known symptoms of this include that existing sessions on a hot-standby
replica sometimes fail to notice new concurrently built indexes and
visibility map updates.

The solution is to WAL log such invalidations in transactions without an
xid. We considered to alternatively force-assign an xid, but that'd be
problematic for vacuum, which might be run in systems with few xids.

Important: This adds a new WAL record, but as the patch has to be
back-patched, we can't bump the WAL page magic. This means that standbys
have to be updated before primaries; otherwise
"PANIC: standby_redo: unknown op code 32" errors can be encountered.

XXX:

Reported-By: Васильев Дмитрий, Masahiko Sawada
Discussion:
    CAB-SwXY6oH=9twBkXJtgR4UC1NqT-vpYAtxCseME62ADwyK5OA@mail.gmail.com
    CAD21AoDpZ6Xjg=gFrGPnSn4oTRRcwK1EBrWCq9OqOHuAcMMC=w@mail.gmail.com
src/backend/access/rmgrdesc/standbydesc.c
src/backend/access/rmgrdesc/xactdesc.c
src/backend/access/transam/xact.c
src/backend/replication/logical/decode.c
src/backend/replication/logical/reorderbuffer.c
src/backend/storage/ipc/standby.c
src/backend/utils/cache/inval.c
src/include/replication/reorderbuffer.h
src/include/storage/standby.h
src/include/storage/standbydefs.h