Re: Hot Standby btree delete records and vacuum_defer_cleanup_age - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Hot Standby btree delete records and vacuum_defer_cleanup_age
Date
Msg-id 4D001731.80005@enterprisedb.com
Whole thread Raw
In response to Hot Standby btree delete records and vacuum_defer_cleanup_age  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Hot Standby btree delete records and vacuum_defer_cleanup_age  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: serializable read only deferrable
Next
From: Jeff Janes
Date:
Subject: Re: XLog vs SSD [Was: Re: random write in xlog?]