Re: Hot Standby btree delete records and vacuum_defer_cleanup_age

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hot Standby btree delete records and vacuum_defer_cleanup_age
Date: 2010-12-08 23:39:29
Message-ID: 4D001731.80005@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2010-12-09 03:20:09 Re: XLog vs SSD [Was: Re: random write in xlog?]
Previous Message Kevin Grittner 2010-12-08 23:34:03 Re: serializable read only deferrable