Re: GIN improvements part 1: additional information - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: GIN improvements part 1: additional information
Date
Msg-id 52E22968.2050100@vmware.com
Whole thread Raw
In response to Re: GIN improvements part 1: additional information  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: GIN improvements part 1: additional information  (Alexander Korotkov <aekorotkov@gmail.com>)
List pgsql-hackers
On 01/24/2014 10:03 AM, Alexander Korotkov wrote:
> ITSM I found this bug. ginVacuumPostingTreeLeaf re-encodes only some
> segments. Others are not even re-palloced. They are moved left
> in dataPlaceToPageLeafRecompress by memcpy. But it's incorrect to with
> memcpy, proper solution is memmove. Using memcpy platform dependently can
> lead to page corruption. Another solution is to re-palloc segments in
> ginVacuumPostingTreeLeaf.

Good catch. Thanks, committed, changing memcpy to memmove. Will have to 
switch to pallocing everything in the future, if we make leafRepackItems 
smarter, so that it doesn't rewrite all the segments after the first 
modified one.

- Heikki



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: ALTER TABLE lock strength reduction patch is unsafe
Next
From: Alexander Korotkov
Date:
Subject: Re: GIN improvements part 1: additional information