On 08.12.2010 16:00, Simon Riggs wrote:
>
> Heikki pointed out to me that the btree delete record processing does
> not respect vacuum_defer_cleanup_age. It should.
>
> Attached patch to implement that.
This doesn't look right to me. btree_xlog_delete_get_latestRemovedXid()
function calculates the latest XID present on the tuples that we're
removing b-tree pointers for. btree_xlog_delete_get_latestRemovedXid()
is used during recovery. vacuum_defer_cleanup_age should take effect in
the master, not during recovery.
With the patch, btree_xlog_delete_get_latestRemovedXid() returns a value
that's much smaller than it should. That's just wrong, it means that
recovery in the standby will incorrectly think that all the removed
tuples are old and not visible to any running read-only queries anymore,
and will go ahead and remove the index tuples for them.
-- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com