Thread: pgsql: Fix interference between cavering indexes and partitionedtables

pgsql: Fix interference between cavering indexes and partitionedtables

From
Teodor Sigaev
Date:
Fix interference between cavering indexes and partitioned tables

The bug is caused due to the original IndexStmt that DefineIndex receives
being overwritten when processing the INCLUDE columns. Use separate list of
index params to propagate to child tables. Add tests covering this case.

Amit Langote and Alexander Korotkov.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5c6110c6a960ad6fe1b0d0fec6ae36ef4eb913f5

Modified Files
--------------
src/backend/commands/indexcmds.c       | 27 ++++++++++++++-------------
src/test/regress/expected/indexing.out | 24 ++++++++++++++++++++++++
src/test/regress/sql/indexing.sql      | 19 +++++++++++++++++++
3 files changed, 57 insertions(+), 13 deletions(-)


Re: pgsql: Fix interference between cavering indexes and partitionedtables

From
Teodor Sigaev
Date:
Seems, something is wrong here, investigating...


Teodor Sigaev wrote:
> Fix interference between cavering indexes and partitioned tables
> 
> The bug is caused due to the original IndexStmt that DefineIndex receives
> being overwritten when processing the INCLUDE columns. Use separate list of
> index params to propagate to child tables. Add tests covering this case.
> 
> Amit Langote and Alexander Korotkov.
> 
> Branch
> ------
> master
> 
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/5c6110c6a960ad6fe1b0d0fec6ae36ef4eb913f5
> 
> Modified Files
> --------------
> src/backend/commands/indexcmds.c       | 27 ++++++++++++++-------------
> src/test/regress/expected/indexing.out | 24 ++++++++++++++++++++++++
> src/test/regress/sql/indexing.sql      | 19 +++++++++++++++++++
> 3 files changed, 57 insertions(+), 13 deletions(-)
> 

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/


Re: pgsql: Fix interference between cavering indexes and partitionedtables

From
Teodor Sigaev
Date:
> Seems, something is wrong here, investigating...

pg_upgrade test fails only with -O2 on my box. Assert, debug could be any.



-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/


Re: pgsql: Fix interference between cavering indexes and partitionedtables

From
Andres Freund
Date:
On 2018-04-11 19:04:53 +0300, Teodor Sigaev wrote:
> 
> > Seems, something is wrong here, investigating...
> 
> pg_upgrade test fails only with -O2 on my box. Assert, debug could be any.

Several of the failing animals aren't using optimization, so it can't be
just that. I think it might make sense considering reverting and trying
to figure this out, without turning half the buildfarm red?

Greetings,

Andres Freund


Re: pgsql: Fix interference between cavering indexes and partitionedtables

From
Teodor Sigaev
Date:

Andres Freund wrote:
> On 2018-04-11 19:04:53 +0300, Teodor Sigaev wrote:
>>
>>> Seems, something is wrong here, investigating...
>>
>> pg_upgrade test fails only with -O2 on my box. Assert, debug could be any.
> 
> Several of the failing animals aren't using optimization, so it can't be
> just that. I think it might make sense considering reverting and trying
Yep, but on my notebook - only with -02

> to figure this out, without turning half the buildfarm red?Agree, five minutes

-- 
Teodor Sigaev                                   E-mail: teodor@sigaev.ru
                                                    WWW: http://www.sigaev.ru/


Re: pgsql: Fix interference between cavering indexes and partitioned tables

From
Peter Geoghegan
Date:
On Wed, Apr 11, 2018 at 9:17 AM, Teodor Sigaev <teodor@sigaev.ru> wrote:
>> Several of the failing animals aren't using optimization, so it can't be
>> just that. I think it might make sense considering reverting and trying
>
> Yep, but on my notebook - only with -02

I suggest using Valgrind to make sure that a patch + tests don't have
a problem like this before pushing. That's not perfect, of course, but
it's an easy way to save yourself some trouble.

-- 
Peter Geoghegan