Re: Hot Standby btree delete records and vacuum_defer_cleanup_age

Lists: pgsql-hackers
From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Hot Standby btree delete records and vacuum_defer_cleanup_age
Date: 2010-12-08 15:00:51
Message-ID: 1291820451.2872.910.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


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.

Looking to commit in next few hours barring objections/suggestions, to
both HEAD and 9_0_STABLE, in time for next minor release.

--
Simon Riggs http://www.2ndQuadrant.com/books/
PostgreSQL Development, 24x7 Support, Training and Services

Attachment Content-Type Size
btree_vac_cleanup_age.v1.patch text/x-patch 2.2 KB

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, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Hot Standby btree delete records and vacuum_defer_cleanup_age
Date: 2010-12-08 23:10:23
Message-ID: 4D00105F.7080203@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
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.
>
> Looking to commit in next few hours barring objections/suggestions, to
> both HEAD and 9_0_STABLE, in time for next minor release.

Please note that it was Noah Misch that raised this a while ago:

http://archives.postgresql.org/pgsql-hackers/2010-11/msg01919.php

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


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, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Hot Standby btree delete records and vacuum_defer_cleanup_age
Date: 2010-12-08 23:16:26
Message-ID: 4D0011CA.7040606@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 09.12.2010 00:10, Heikki Linnakangas wrote:
> 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.
>>
>> Looking to commit in next few hours barring objections/suggestions, to
>> both HEAD and 9_0_STABLE, in time for next minor release.
>
> Please note that it was Noah Misch that raised this a while ago:
>
> http://archives.postgresql.org/pgsql-hackers/2010-11/msg01919.php

On closer look, that's not actually the same issue, sorry for the noise..

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


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
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


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hot Standby btree delete records and vacuum_defer_cleanup_age
Date: 2010-12-09 07:52:11
Message-ID: 1291881131.2872.1982.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, 2010-12-09 at 00:39 +0100, Heikki Linnakangas wrote:

> vacuum_defer_cleanup_age should take effect in
> the master, not during recovery.

Hmmm, more to the point, it does take effect on the master and so there
is no need for this at all. What were you thinking? What was I? Doh.

--
Simon Riggs http://www.2ndQuadrant.com/books/
PostgreSQL Development, 24x7 Support, Training and Services


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Hot Standby btree delete records and vacuum_defer_cleanup_age
Date: 2010-12-09 07:55:46
Message-ID: 1291881346.2872.1988.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, 2010-12-09 at 00:16 +0100, Heikki Linnakangas wrote:
> On 09.12.2010 00:10, Heikki Linnakangas wrote:
> > 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.
> >>
> >> Looking to commit in next few hours barring objections/suggestions, to
> >> both HEAD and 9_0_STABLE, in time for next minor release.
> >
> > Please note that it was Noah Misch that raised this a while ago:
> >
> > http://archives.postgresql.org/pgsql-hackers/2010-11/msg01919.php
>
> On closer look, that's not actually the same issue, sorry for the noise..

Heikki, this one *is* important. Will fix. Thanks for the analysis Noah.

--
Simon Riggs http://www.2ndQuadrant.com/books/
PostgreSQL Development, 24x7 Support, Training and Services


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Hot Standby btree delete records and vacuum_defer_cleanup_age
Date: 2011-03-11 04:21:51
Message-ID: AANLkTikZSj=ZCm79MxwnzRoKO5_Rh8Wm84EHM8KyQzzo@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Dec 9, 2010 at 4:55 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On Thu, 2010-12-09 at 00:16 +0100, Heikki Linnakangas wrote:
>> On 09.12.2010 00:10, Heikki Linnakangas wrote:
>> > 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.
>> >>
>> >> Looking to commit in next few hours barring objections/suggestions, to
>> >> both HEAD and 9_0_STABLE, in time for next minor release.
>> >
>> > Please note that it was Noah Misch that raised this a while ago:
>> >
>> > http://archives.postgresql.org/pgsql-hackers/2010-11/msg01919.php
>>
>> On closer look, that's not actually the same issue, sorry for the noise..
>
> Heikki, this one *is* important. Will fix. Thanks for the analysis Noah.

Is this an open item for 9.1?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Hot Standby btree delete records and vacuum_defer_cleanup_age
Date: 2011-03-11 07:46:10
Message-ID: 4D79D342.7070108@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 11.03.2011 06:21, Fujii Masao wrote:
> On Thu, Dec 9, 2010 at 4:55 PM, Simon Riggs<simon(at)2ndquadrant(dot)com> wrote:
>> On Thu, 2010-12-09 at 00:16 +0100, Heikki Linnakangas wrote:
>>> On 09.12.2010 00:10, Heikki Linnakangas wrote:
>>>> 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.
>>>>>
>>>>> Looking to commit in next few hours barring objections/suggestions, to
>>>>> both HEAD and 9_0_STABLE, in time for next minor release.
>>>>
>>>> Please note that it was Noah Misch that raised this a while ago:
>>>>
>>>> http://archives.postgresql.org/pgsql-hackers/2010-11/msg01919.php
>>>
>>> On closer look, that's not actually the same issue, sorry for the noise..
>>
>> Heikki, this one *is* important. Will fix. Thanks for the analysis Noah.
>
> Is this an open item for 9.1?

Simon fixed it, commit b9075a6d2f9b07a00262a670dd60272904c79dce.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: Hot Standby btree delete records and vacuum_defer_cleanup_age
Date: 2011-03-11 08:03:55
Message-ID: AANLkTi=6y=q=t6+Hm9ovfJpeKmxAqbFhzf+hxLqR-WC3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Fri, Mar 11, 2011 at 4:46 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>> Is this an open item for 9.1?
>
> Simon fixed it, commit b9075a6d2f9b07a00262a670dd60272904c79dce.

Oh, thanks!

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center