On 2016-02-27 01:16:34 +0000, Simon Riggs wrote: > If the above is true, then the proposed fix wouldn't work either. > > No point in sending a cache invalidation message on the standby if you > haven't also written WAL, since the catalog re-read would just see the old > row. > > heap_inplace_update() does write WAL, which blows away the starting premise.
I'm not following here. heap_inplace_update() indeed writes WAL, but it does *NOT* (and may not) assign an xid. Thus we're not emitting the relcache invalidation queued in DefineIndex(), as RecordTransactionCommit() currently skips emitting a commit record if there's no xid.
OK.
Surely then the fix is to make heap_inplace_update() assign an xid? That way any catalog change will always generate a commit record containing the invalidation that goes with the change. No need to fix up the breakage later.
The other heap_insert|update|delete functions (and similar) all assign xid, so it is consistent for us to do that for inplace_update also.