[MCOL-4425] INSERT..SELECT hangs on cpimport when MCS is installed in a non-default path Created: 2020-12-01  Updated: 2020-12-07  Resolved: 2020-12-04

Status: Closed
Project: MariaDB ColumnStore
Component/s: writeengine
Affects Version/s: 5.4.3
Fix Version/s: 5.5.1

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: 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:"))


Generated at Thu Feb 08 02:50:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.