You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@madlib.apache.org by "Frank McQuillan (JIRA)" <ji...@apache.org> on 2018/10/02 23:44:00 UTC

[jira] [Commented] (MADLIB-1275) dev-check user doesn't have right privilege to create/drop table

    [ https://issues.apache.org/jira/browse/MADLIB-1275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16636245#comment-16636245 ] 

Frank McQuillan commented on MADLIB-1275:
-----------------------------------------

The following are three potential solutions:

1) Live with the issue until a customer reports it, since this is a corner case.

2) Have no `drop table` statements at all in IC and DC, but use schema-qualified table names for CREATE table statements. Ensure all output tables created in our tests have unique names (within a file of course). This is good practice too.

- This has a lot of work to do. We should edit existing output table names in all ID/DC files along with removing all the drop statements. This cannot be easily scripted, so it is considerable manual effort.

- If somebody forgets to follow this guideline, and is not caught in our reviews, the issue in this story will still stay without any of our tests going red.

3) Use schema-qualified names for all madlib function/types. We should also remove madlib installation schema from search path in madpack.

- There is a good chance our tests will fail if a developer forgets to use schema-qualified names for madlib functions and types. I say good chance because one can always circumvent this by setting the search path within an IC/DC file.

- This puts extra burden on developers to always use schema-qualified function names.


> dev-check user doesn't have right privilege to create/drop table 
> -----------------------------------------------------------------
>
>                 Key: MADLIB-1275
>                 URL: https://issues.apache.org/jira/browse/MADLIB-1275
>             Project: Apache MADlib
>          Issue Type: Bug
>          Components: Madpack
>            Reporter: Jingyi Mei
>            Priority: Minor
>
> Repro:
>  login to your database
> {code:java}
> set search_path=madlib,public,"$user";{code}
> manually create a table "vertex":
> {code:java}
> DROP TABLE IF EXISTS vertex, "EDGE";
> CREATE TABLE vertex(
> id INTEGER
> );
> INSERT INTO vertex VALUES
> (0),
> (1),
> (2),
> (3),
> (4),
> (5),
> (6);{code}
> Then run dev-check for pagerank:
> {code:java}
> ./src/bin/madpack -p greenplum -c /madlib dev-check -t graph/pagerank{code}
>  
> Then it will fail and here is the error message:
> {code:java}
> DROP TABLE IF EXISTS vertex, "EDGE";
> 28 psql:/tmp/madlib.Ph19IE/graph/pagerank.sql_in.tmp:28: ERROR: must be owner of relation vertex{code}
>  
> Cause:
> When user manually creates vertex table, it goes to madlib schema because of the search_path settings/
> When running Install/Dev check, madpack will set 
> {code:java}
> SET search_path=madlib_installcheck_graph,madlib;{code}
> During dev-check, it tries to drop vertex table and found it under madlib schema, it will fail because it was another user that created vertex table in the same schema.
>  
> Solution:
> 1) In madpack, only SET search_path=madlib_installcheck_graph and remove madlib schema.
> 2) In all the Install/Dev check sql files, when we call madlib function, we explicitly call \{schema_madlib}.function_name instead of directly call function_name and let it go through search_path.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)