trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nonstop-qfchen <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: Jira1443 final committed
Date Mon, 21 Sep 2015 18:38:02 GMT
Github user nonstop-qfchen commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/87#discussion_r40008277
  
    --- Diff: core/sql/ustat/hs_globals.cpp ---
    @@ -2887,6 +2890,22 @@ Lng32 HSGlobalsClass::Initialize()
             HSHandleError(retcode);
             TM->Commit(); // Must commit this transaction (even if schema didn't get created).
           }
    +                                              /*=====================================*/
    +                                              /*   CREATE HBASE STATS SCHEMA        
*/
    +                                              /*   typically as trafodion.hbasestats
*/
    +                                              /*=====================================*/
    +    if (isNativeHbaseCat(objDef->getCatName()))
    +      {
    +        HSTranMan *TM = HSTranMan::Instance(); // Must have transaction around this.
    +        TM->Begin("Create schema for native hbase stats.");
    +        NAString ddl = "CREATE SCHEMA IF NOT EXISTS ";
    +        ddl.append(HBASE_STATS_CATALOG).append('.').append(HBASE_STATS_SCHEMA);
    +        retcode = HSFuncExecQuery(ddl, -UERR_INTERNAL_ERROR, NULL,
    +                                  "Creating schema for native HBase statistics", NULL,
    +                                  NULL);
    +        HSHandleError(retcode);
    +        TM->Commit(); // Must commit this transaction (even if schema didn't get created).
    --- End diff --
    
    The comment is misleading.  The Commit method actually checks retched_ and
    if it is less than 0 indicating an error had occurred, the method does
    nothing more other than log the error code to ULOG.
    
    I'l fix the comment to indicate this.
    
    
    On Mon, Sep 21, 2015 at 1:25 PM, Roberta Marton <notifications@github.com>
    wrote:
    
    > In core/sql/ustat/hs_globals.cpp
    > <https://github.com/apache/incubator-trafodion/pull/87#discussion_r40006615>
    > :
    >
    > > @@ -2887,6 +2890,22 @@ Lng32 HSGlobalsClass::Initialize()
    > >          HSHandleError(retcode);
    > >          TM->Commit(); // Must commit this transaction (even if schema didn't
get created).
    > >        }
    > > +                                              /*=====================================*/
    > > +                                              /*   CREATE HBASE STATS SCHEMA
        */
    > > +                                              /*   typically as trafodion.hbasestats
*/
    > > +                                              /*=====================================*/
    > > +    if (isNativeHbaseCat(objDef->getCatName()))
    > > +      {
    > > +        HSTranMan *TM = HSTranMan::Instance(); // Must have transaction around
this.
    > > +        TM->Begin("Create schema for native hbase stats.");
    > > +        NAString ddl = "CREATE SCHEMA IF NOT EXISTS ";
    > > +        ddl.append(HBASE_STATS_CATALOG).append('.').append(HBASE_STATS_SCHEMA);
    > > +        retcode = HSFuncExecQuery(ddl, -UERR_INTERNAL_ERROR, NULL,
    > > +                                  "Creating schema for native HBase statistics",
NULL,
    > > +                                  NULL);
    > > +        HSHandleError(retcode);
    > > +        TM->Commit(); // Must commit this transaction (even if schema didn't
get created).
    >
    > Just curious, why commit a failed request. If the create schema failed,
    > could it leave the metadata in on inconsistent state? i.e., creating a
    > schema updates several metadata tables, if the operation failed after
    > updating one table (e.g. OBJECTS) but before it completes another (e.g.
    > TABLES) there could be an issue.
    >
    > —
    > Reply to this email directly or view it on GitHub
    > <https://github.com/apache/incubator-trafodion/pull/87/files#r40006615>.
    >
    
    
    
    -- 
    Regards, --Qifan



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message