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

ASF GitHub Bot commented on HAWQ-273:
-------------------------------------

Github user wangzw commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/211#discussion_r48393686
  
    --- Diff: src/backend/tcop/postgres.c ---
    @@ -1645,7 +1645,7 @@ exec_simple_query(const char *query_string, const 
char *seqServerHost, int seqSe
                querytree_list = pg_analyze_and_rewrite(parsetree, query_string,
                                                                                
                NULL, 0);
     
    -           plantree_list = pg_plan_queries(querytree_list, NULL, false, 
QRL_ONCE);
    +           plantree_list = pg_plan_queries(querytree_list, NULL, true, 
QRL_ONCE);
     
    --- End diff --
    
    It's not right
    ```
    A snapshot must be set before invoking the planner, since it
     * might try to evaluate user-defined functions.  But we must not set a
     * snapshot if the list contains only utility statements, because some
     * utility statements depend on not having frozen the snapshot yet.
    ```
    
    Snapshot for plannable statement was set before, see line 1631. 


> Concurrent read committed SELECT return 0 rows for AO table which is ALTERed 
> with REORGANIZE by other transaction
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: HAWQ-273
>                 URL: https://issues.apache.org/jira/browse/HAWQ-273
>             Project: Apache HAWQ
>          Issue Type: Bug
>          Components: Transaction
>            Reporter: Ming LI
>            Assignee: Ming LI
>
> testdb=# DROP TABLE tbl_isolation;
> DROP TABLE
> testdb=# CREATE TABLE tbl_isolation (a INT, b int, c int) WITH 
> (appendonly=true);
> CREATE TABLE
> testdb=# INSERT INTO tbl_isolation SELECT generate_series(1, 100000), 
> generate_series(1, 100000), generate_series(1, 100000);
> INSERT 0 100000
> •
> Thread A:
> testdb=# BEGIN transaction isolation level SERIALIZABLE;
> BEGIN
> testdb=# ALTER TABLE tbl_isolation set with ( reorganize='true') distributed 
> randomly;
> ALTER TABLE
> •
> Thread B:
> testdb=# BEGIN transaction isolation level read committed;
> BEGIN
> testdb=# select count(*) from tbl_isolation;
> •
> Thread A:
> testdb=# commit;
> COMMIT
> •
> •
> Thread B:
> testdb=# select count(*) from tbl_isolation;
> count
> -------
> 0
> (1 row)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to