On Tue, Nov 1, 2016 at 5:06 PM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> On Wed, Oct 5, 2016 at 11:28 PM, Thomas Munro
> <thomas.munro@enterprisedb.com> wrote:
>> [dsa-v3.patch]
>
> Here is a new version which just adds CLOBBER_FREED_MEMORY support to dsa_free.
Here is a new version that fixes a bug I discovered in freepage.c today.
Details: When dsa_free decides to give back a whole superblock back
to the free page manager for a segment with FreePageManagerPut, and
there was already exactly one span of exactly one free page in that
segment, and the span being 'put' is not adjacent to that existing
free page, then the singleton format must be converted to a btree with
the existing page as root and the newly put span as the sole leaf.
But in that special case we forgot to add the newly put span to the
appropriate free list. Not only did we lose track of it, but a future
call to FreePageManagerPut might try to merge it with another adjacent
span, which will try to manipulate the freelist that it expects it to
be in and blow up. The fix is just to add a call to
FreePagePushSpanLeader in this corner case before the early return.
--
Thomas Munro
http://www.enterprisedb.com