New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ORCA for a partition with rewritten rules causes gp crash #5913

Open
darthunix opened this Issue Oct 3, 2018 · 3 comments

Comments

Projects
None yet
5 participants
@darthunix
Copy link

darthunix commented Oct 3, 2018

Greenplum version or build

Greenplum 5.8.0

Summary

It is possible to rewrite rules for an existing table's partition though in a case of partition exchange it is prohibited to use a table with rewritten rules. After adding rules to a partition legacy optimiser returns an error (it is ok) but ORCA causes gp crash.

Step to reproduce the behavior

create table t1 (id int, stamp date, amount int)
with (appendonly=false)
distributed by (id)
partition by range (stamp) (
  start ('2016-01-01') end ('2019-01-01') every(interval '1 year'),
  default partition extra
);

select * from pg_partitions where tablename ='t1';
-- rank: 3, partition: t1_1_prt_4

create rule "_RETURN" as on select to t1_1_prt_4 do instead 
select 1 as id, current_date as stamp, 1 as amount;

set optimizer=off;
select * from t1;
-- ERROR:  plan contains range table with relstorage='v' (allpaths.c:346)

set optimizer=on;
select * from t1;
-- [OPT]: Using default search strategy
-- server closed the connection unexpectedly
--         This probably means the server terminated abnormally
--         before or while processing the request.
-- The connection to the server was lost. Attempting reset: Failed.

Expected behavior

There are two ways I think

  1. ORCA doesn't cause a gp crash but returns an error
  2. A user is prohibited to rewrite rules for a table that acts as a partition
@kapustor

This comment has been minimized.

Copy link

kapustor commented Oct 3, 2018

Greenplum 5.11.0 has the same issue - master crashes.

@vraghavan78 vraghavan78 self-assigned this Oct 6, 2018

@vraghavan78 vraghavan78 added the GPORCA label Oct 6, 2018

@bhuvnesh2703

This comment has been minimized.

@hlinnaka

This comment has been minimized.

Copy link
Member

hlinnaka commented Jan 16, 2019

PR 6364 was merged. Has this issue been fully resolved now? Can we close it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment