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

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

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

    
https://github.com/apache/incubator-trafodion/pull/1138#discussion_r123588617
  
    --- Diff: core/sqf/sql/scripts/rmscheck ---
    @@ -21,7 +21,28 @@
     #
     # @@@ END COPYRIGHT @@@
     #
    -# Most of this was stolen from WMScheck...  which may have started as 
NDCScheck
    +
    +if [ -z $TRAF_HOME ]; then
    +    echo
    +    echo "The TRAF_HOME environment variable does not exist."
    +    echo "Please ensure sqenv.sh has been sourced."
    +    echo
    +    exit 1;
    +fi
    +
    +# Check whether the Trafodion environment up.
    +sqcheck -i 1 -d 1 > /dev/null 2>&1
    +sq_stat=$?
    +if [[ $sq_stat == 255 ]]; then
    +   echo "The Trafodion environment is down. Exiting..."
    +   exit 1
    +fi
    +
    +# Generate the 'rmscheck.sql' file
    +temp_rmscheck_sql=`mktemp -t`
    +sqgenrmscheck $temp_rmscheck_sql
    +echo temp_rmscheck_sql=$temp_rmscheck_sql
     
     echo "Timestamp                           Id    Status "
    -sqlci -i $TRAF_HOME/sql/scripts/rmscheck.sql | grep 'Node\|ERROR' | grep 
-v varchar
    +sqlci -i $temp_rmscheck_sql | grep 'Node\|ERROR' | grep -v varchar
    +rm -f $temp_rmscheck_sql
    --- End diff --
    
    Yes, this would be better. Scripting is not one of my strengths.


> Method used in 'rmscheck' script for obtaining status is incompatible with 
> elasticity
> -------------------------------------------------------------------------------------
>
>                 Key: TRAFODION-2649
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-2649
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: foundation
>    Affects Versions: 2.2-incubating
>            Reporter: Gonzalo E Correa
>            Assignee: Gonzalo E Correa
>             Fix For: 2.2-incubating
>
>
> The 'sqgen' scripts generate the 'rmscheck.sql' input file invoke by sqlci 
> through the rmscheck script. The cluster membership is derived at 'sqgen' 
> time which uses the existing node membership at a point in time. Since the 
> node membership of the cluster can change at any time after the 'sqgen' 
> invocation, the 'rmscheck.sql' input is by definition obsolete when the node 
> membership changes, i.e., nodes are added or deleted.
> A different method for obtaining rms status must be implemented. 
> The current method generates the following contents of the 'rmschecl.sql' 
> input file:
> cat rmscheck.sql
> -- SQ config/utility file generated @ Thu Jun 01 14:00:58 2017
> prepare rms_check from select current_timestamp,
> cast('Node' as varchar(5)),
> cast(tokenstr('nodeId:', variable_info) as varchar(3)) node,
> cast(tokenstr('Status:', variable_info) as varchar(10)) status
> from table(statistics(null, ?));
> execute rms_check using 'RMS_CHECK=0' ;
> execute rms_check using 'RMS_CHECK=1' ;



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to