Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-4425

INSERT..SELECT hangs on cpimport when MCS is installed in a non-default path

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 5.4.3
    • 5.5.1
    • writeengine
    • None

    Description

      To repeat the problem:

      • Compile MariaDB with ColumnStore with a non-default -DCMAKE_INSTALL_PREFIX
      • Do "make install"
      • Do all necessary post-installation steps and start MariaDB/ColumnStore
      • Run this SQL script:

        DROP TABLE IF EXISTS t1,t2;
        CREATE TABLE t1 (a INT) ENGINE=ColumnStore;
        INSERT INTO t1 VALUES (1);
        CREATE TABLE t2 (a INT) ENGINE=ColumnStore;
        INSERT INTO t2 SELECT * FROM t1;
        

      The problem happens because of this code in writeengine/splitter/we_cmdargs.cpp:

           if (argc > 0)
               fPrgmName = "cpimport.bin"; //argv[0] is splitter but we need cpimport
      

      so later this call fails:

      int aRet = execvp(Cmds[0], &Cmds[0]);
      

      This message is added to /var/log/mariadb/columnstore/err.log:

      Nov 27 17:29:44 home writeengineserver[150739]: 44.235562 |0|0|0| E 32 CAL0000: 7571 : execv error: cpimport.bin invocation failed; (errno-9); No such file or directory; Check file and try 
      

      The solution is to add full patch when constructing the cpimport command line:

      diff --git a/writeengine/splitter/we_cmdargs.cpp b/writeengine/splitter/we_cmdargs.cpp
      index 30716252..311953d3 100644
      --- a/writeengine/splitter/we_cmdargs.cpp
      +++ b/writeengine/splitter/we_cmdargs.cpp
      @@ -43,6 +43,7 @@ using namespace oam;
       #include "we_cmdargs.h"
       
       #include "installdir.h"
      +#include "mcsconfig.h"
       
       namespace WriteEngine
       {
      @@ -598,7 +599,7 @@ void WECmdArgs::parseCmdLineArgs(int argc, char** argv)
       
       
           if (argc > 0)
      -        fPrgmName = "cpimport.bin"; //argv[0] is splitter but we need cpimport
      +        fPrgmName = string(MCSBINDIR) + "/" + "cpimport.bin"; //argv[0] is splitter but we need cpimport
       
           while ((aCh = getopt(argc, argv,
                                "d:j:w:s:v:l:r:b:e:B:f:q:ihm:E:C:P:I:n:p:c:ST:Ny:K:t:H:g:U:"))
      

      Attachments

        Activity

          bar Alexander Barkov created issue -
          bar Alexander Barkov made changes -
          Field Original Value New Value
          Rank Ranked higher
          David.Hall David Hall (Inactive) made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          bar Alexander Barkov made changes -
          Description To repeat the problem:
          - Compile MariaDB with ColumnStore with a non-default -DCMAKE_INSTALL_PREFIX
          - Do "make install"
          - Do all necessary post-installation steps and start MariaDB/ColumnStore
          - Run this SQL script:
          {code:sql}
          DROP TABLE IF EXISTS t1,t2;
          CREATE TABLE t1 (a INT) ENGINE=ColumnStore;
          INSERT INTO t1 VALUES (1);
          CREATE TABLE t2 (a INT) ENGINE=ColumnStore;
          INSERT INTO t2 SELECT * FROM t1;
          {code}

          The problem happens because of this code in writeengine/splitter/we_cmdargs.cpp:

          {code:cpp}
               if (argc > 0)
                   fPrgmName = "cpimport.bin"; //argv[0] is splitter but we need cpimport
          {code}

          so later this call fails:
          {code:cpp}
          int aRet = execvp(Cmds[0], &Cmds[0]);
          {code}

          This message is added to {{/var/log/mariadb/columnstore/err.log}}:
          {noformat}
          Nov 27 17:29:44 home writeengineserver[150739]: 44.235562 |0|0|0| E 32 CAL0000: 7571 : execv error: cpimport.bin invocation failed; (errno-9); No such file or directory; Check file and try
          {noformat}


          The solution is to add full patch when constructing the cpimport command line:
          {code:cpp}
          diff --git a/writeengine/splitter/we_cmdargs.cpp b/writeengine/splitter/we_cmdargs.cpp
          index 30716252..311953d3 100644
          --- a/writeengine/splitter/we_cmdargs.cpp
          +++ b/writeengine/splitter/we_cmdargs.cpp
          @@ -43,6 +43,7 @@ using namespace oam;
           #include "we_cmdargs.h"
           
           #include "installdir.h"
          +#include "mcsconfig.h"
           
           namespace WriteEngine
           {
          @@ -598,7 +599,7 @@ void WECmdArgs::parseCmdLineArgs(int argc, char** argv)
           
           
               if (argc > 0)
          - fPrgmName = "cpimport.bin"; //argv[0] is splitter but we need cpimport
          + fPrgmName = string(MCSSBINDIR) + "/" + "cpimport.bin"; //argv[0] is splitter but we need cpimport
           
               while ((aCh = getopt(argc, argv,
                                    "d:j:w:s:v:l:r:b:e:B:f:q:ihm:E:C:P:I:n:p:c:ST:Ny:K:t:H:g:U:"))
          {code}
          To repeat the problem:
          - Compile MariaDB with ColumnStore with a non-default -DCMAKE_INSTALL_PREFIX
          - Do "make install"
          - Do all necessary post-installation steps and start MariaDB/ColumnStore
          - Run this SQL script:
          {code:sql}
          DROP TABLE IF EXISTS t1,t2;
          CREATE TABLE t1 (a INT) ENGINE=ColumnStore;
          INSERT INTO t1 VALUES (1);
          CREATE TABLE t2 (a INT) ENGINE=ColumnStore;
          INSERT INTO t2 SELECT * FROM t1;
          {code}

          The problem happens because of this code in writeengine/splitter/we_cmdargs.cpp:

          {code:cpp}
               if (argc > 0)
                   fPrgmName = "cpimport.bin"; //argv[0] is splitter but we need cpimport
          {code}

          so later this call fails:
          {code:cpp}
          int aRet = execvp(Cmds[0], &Cmds[0]);
          {code}

          This message is added to {{/var/log/mariadb/columnstore/err.log}}:
          {noformat}
          Nov 27 17:29:44 home writeengineserver[150739]: 44.235562 |0|0|0| E 32 CAL0000: 7571 : execv error: cpimport.bin invocation failed; (errno-9); No such file or directory; Check file and try
          {noformat}


          The solution is to add full patch when constructing the cpimport command line:
          {code:cpp}
          diff --git a/writeengine/splitter/we_cmdargs.cpp b/writeengine/splitter/we_cmdargs.cpp
          index 30716252..311953d3 100644
          --- a/writeengine/splitter/we_cmdargs.cpp
          +++ b/writeengine/splitter/we_cmdargs.cpp
          @@ -43,6 +43,7 @@ using namespace oam;
           #include "we_cmdargs.h"
           
           #include "installdir.h"
          +#include "mcsconfig.h"
           
           namespace WriteEngine
           {
          @@ -598,7 +599,7 @@ void WECmdArgs::parseCmdLineArgs(int argc, char** argv)
           
           
               if (argc > 0)
          - fPrgmName = "cpimport.bin"; //argv[0] is splitter but we need cpimport
          + fPrgmName = string(MCSBINDIR) + "/" + "cpimport.bin"; //argv[0] is splitter but we need cpimport
           
               while ((aCh = getopt(argc, argv,
                                    "d:j:w:s:v:l:r:b:e:B:f:q:ihm:E:C:P:I:n:p:c:ST:Ny:K:t:H:g:U:"))
          {code}
          bar Alexander Barkov made changes -
          Fix Version/s 5.6.1 [ 25031 ]
          Fix Version/s 5.5.1 [ 25030 ]
          bar Alexander Barkov made changes -
          issue.field.resolutiondate 2020-12-04 15:04:39.0 2020-12-04 15:04:39.267
          bar Alexander Barkov made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          drrtuy Roman made changes -
          Fix Version/s 5.5.1 [ 25030 ]
          Fix Version/s 5.6.1 [ 25031 ]

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.