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

ASF GitHub Bot commented on TRAFODION-2074:
-------------------------------------------

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

    https://github.com/apache/incubator-trafodion/pull/550#discussion_r67738650
  
    --- Diff: core/sql/generator/GenPreCode.cpp ---
    @@ -2824,44 +2823,33 @@ short DDLExpr::ddlXnsInfo(NABoolean &isDDLxn, 
NABoolean &xnCanBeStarted)
            (ddlNode->getOperatorType() == DDL_ALTER_TABLE_DROP_COLUMN) ||
            (ddlNode->getOperatorType() == 
DDL_ALTER_TABLE_ALTER_COLUMN_DATATYPE) ||
            (ddlNode->getOperatorType() == DDL_DROP_TABLE)))
    -    {
    -      // transaction will be started and commited in called methods.
    -      xnCanBeStarted = FALSE;
    -    }
    -
    -  isDDLxn = FALSE;
    -  if ((ddlXns()) || 
    -      ((ddlNode && ddlNode->castToStmtDDLNode() &&
    -        ddlNode->castToStmtDDLNode()->ddlXns())))
    -    isDDLxn = TRUE;
    -
    -  // ddl transactions are on.
    -  // Following commands currently require transactions be started and
    -  // committed in the called methods.
    -  if ((ddlXns()) &&
    -      (
    -           (purgedataHbase()) ||
    -           (upgradeRepos())
    -       )
    -      )
    -    {
    -      // transaction will be started and commited in called methods.
    -      xnCanBeStarted = FALSE;
    -    }
    -
    -  // ddl transactions are on.
    -  // Cleanup and alter commands requires transactions to be started and 
commited
    -  // in the called method.
    -  if ((ddlNode && ddlNode->castToStmtDDLNode() &&
    -       ddlNode->castToStmtDDLNode()->ddlXns()) &&
    -      ((ddlNode->getOperatorType() == DDL_CLEANUP_OBJECTS) ||
    -       (ddlNode->getOperatorType() == DDL_ALTER_TABLE_DROP_COLUMN) ||
    -       (ddlNode->getOperatorType() == 
DDL_ALTER_TABLE_ALTER_COLUMN_DATATYPE)))
    -    {
    -      // transaction will be started and commited in called methods.
    -      xnCanBeStarted = FALSE;
    -    }
    -
    +     {
    +        // transaction will be started and commited in called methods.
    +        xnCanBeStarted = FALSE;
    +     }
    +     isDDLxn = FALSE;
    +  }
    +  else  // When the DDL transaction is turned on
    +  {
    +     isDDLxn = FALSE;
    +     if (ddlNode && ddlNode->castToStmtDDLNode() &&
    +        ddlNode->castToStmtDDLNode()->ddlXns())
    +     isDDLxn = TRUE;
    +
    +     if (purgedataHbase() || upgradeRepos())
    +        // transaction will be started and commited in called methods.
    +        xnCanBeStarted = FALSE;
    +     if ((ddlNode && ddlNode->castToStmtDDLNode() &&
    +          ddlNode->castToStmtDDLNode()->ddlXns()) &&
    +            ((ddlNode->getOperatorType() == DDL_CLEANUP_OBJECTS) ||
    +             (ddlNode->getOperatorType() == DDL_ALTER_TABLE_DROP_COLUMN) ||
    +             (ddlNode->getOperatorType() == DDL_CREATE_INDEX) ||
    --- End diff --
    
    Should POPULATE INDEX be added to this list?
    I see that DDL_POPULATE_INDEX is an enum. I don't know though if popindex 
is a utility that manages its own trandactions and takes care not to use one 
for the load part. It may be worthwhile to check.


> Create index should avoid populating the index within a transaction
> -------------------------------------------------------------------
>
>                 Key: TRAFODION-2074
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2074
>             Project: Apache Trafodion
>          Issue Type: Improvement
>          Components: sql-exe
>    Affects Versions: 2.0-incubating
>            Reporter: Selvaganesan Govindarajan
>            Assignee: Selvaganesan Govindarajan
>             Fix For: 2.1-incubating
>
>
> Populating the index is done via load command. Load command doesn't need 
> transaction. Transactions in Trafodion have 2hr expiry period. If the load 
> takes more than 2 hours to populate the index the create index will always 
> fail. 



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

Reply via email to