1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Merge branch 'develop' into MCOL-3536

This commit is contained in:
David Hall
2020-05-28 14:20:32 -05:00
28 changed files with 300 additions and 256 deletions

View File

@ -86,7 +86,7 @@ else ()
SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost >= 1.53.0" "snappy" "jemalloc" "net-tools") SETA(CPACK_RPM_columnstore-engine_PACKAGE_REQUIRES "boost >= 1.53.0" "snappy" "jemalloc" "net-tools")
endif() endif()
SET(CPACK_RPM_columnstore-engine_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preInstall_storeage_engine.sh) SET(CPACK_RPM_columnstore-engine_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preInstall_storage_engine.sh)
SET(CPACK_RPM_columnstore-engine_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_storage_engine.sh) SET(CPACK_RPM_columnstore-engine_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/postInstall_storage_engine.sh)
SET(CPACK_RPM_columnstore-engine_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preUn_storage_engine.sh) SET(CPACK_RPM_columnstore-engine_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/build/preUn_storage_engine.sh)

View File

@ -1,5 +1,5 @@
/* Copyright (C) 2014 InfiniDB, Inc. /* Copyright (C) 2014 InfiniDB, Inc.
* Copyright (C) 2016 MariaDB Corporation. * Copyright (C) 2016-2020 MariaDB Corporation.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
@ -36,6 +36,8 @@
#include <ctime> #include <ctime>
#include <algorithm> #include <algorithm>
#include <unistd.h> #include <unistd.h>
#include <chrono>
#include <thread>
using namespace std; using namespace std;
#include <boost/scoped_array.hpp> #include <boost/scoped_array.hpp>
@ -240,11 +242,10 @@ void DistributedEngineComm::Setup()
newClients.clear(); newClients.clear();
newLocks.clear(); newLocks.clear();
throttleThreshold = fRm->getDECThrottleThreshold();
uint32_t newPmCount = fRm->getPsCount(); uint32_t newPmCount = fRm->getPsCount();
int cpp = (fIsExeMgr ? fRm->getPsConnectionsPerPrimProc() : 1); throttleThreshold = fRm->getDECThrottleThreshold();
tbpsThreadCount = fRm->getJlNumScanReceiveThreads(); tbpsThreadCount = fRm->getJlNumScanReceiveThreads();
unsigned numConnections = newPmCount * cpp; unsigned numConnections = getNumConnections();
oam::Oam oam; oam::Oam oam;
ModuleTypeConfig moduletypeconfig; ModuleTypeConfig moduletypeconfig;
@ -386,51 +387,59 @@ void DistributedEngineComm::Listen(boost::shared_ptr<MessageQueueClient> client,
Error: Error:
// @bug 488 - error condition! push 0 length bs to messagequeuemap and // @bug 488 - error condition! push 0 length bs to messagequeuemap and
// eventually let jobstep error out. // eventually let jobstep error out.
/* boost::mutex::scoped_lock lk(fMlock); boost::mutex::scoped_lock lk(fMlock);
//cout << "WARNING: DEC READ 0 LENGTH BS FROM " << client->otherEnd()<< endl; MessageQueueMap::iterator map_tok;
sbs.reset(new ByteStream(0));
MessageQueueMap::iterator map_tok; for (map_tok = fSessionMessages.begin(); map_tok != fSessionMessages.end(); ++map_tok)
sbs.reset(new ByteStream(0)); {
map_tok->second->queue.clear();
(void)atomicops::atomicInc(&map_tok->second->unackedWork[0]);
map_tok->second->queue.push(sbs);
}
lk.unlock();
for (map_tok = fSessionMessages.begin(); map_tok != fSessionMessages.end(); ++map_tok) if (fIsExeMgr)
{ {
map_tok->second->queue.clear(); //std::cout << "WARNING: DEC READ 0 LENGTH BS FROM "
(void)atomicops::atomicInc(&map_tok->second->unackedWork[0]); // << client->otherEnd()<< " OR GOT AN EXCEPTION READING" << std::endl;
map_tok->second->queue.push(sbs); decltype(pmCount) originalPMCount = pmCount;
} // Re-establish if a remote PM restarted.
lk.unlock(); std::this_thread::sleep_for(std::chrono::seconds(3));
Setup();
if (originalPMCount != pmCount)
{
ostringstream os;
os << "DEC: lost connection to " << client->addr2String();
writeToLog(__FILE__, __LINE__, os.str(), LOG_TYPE_ERROR);
}
// reset the pmconnection vector /*
ClientList tempConns; // reset the pmconnection vector
ClientList tempConns;
boost::mutex::scoped_lock onErrLock(fOnErrMutex);
string moduleName = client->moduleName();
//cout << "moduleName=" << moduleName << endl;
for ( uint32_t i = 0; i < fPmConnections.size(); i++)
{
if (moduleName != fPmConnections[i]->moduleName())
tempConns.push_back(fPmConnections[i]);
//else
//cout << "DEC remove PM" << fPmConnections[i]->otherEnd() << " moduleName=" << fPmConnections[i]->moduleName() << endl;
}
{ if (tempConns.size() == fPmConnections.size()) return;
boost::mutex::scoped_lock onErrLock(fOnErrMutex);
string moduleName = client->moduleName();
//cout << "moduleName=" << moduleName << endl;
for ( uint32_t i = 0; i < fPmConnections.size(); i++)
{
if (moduleName != fPmConnections[i]->moduleName())
tempConns.push_back(fPmConnections[i]);
//else
//cout << "DEC remove PM" << fPmConnections[i]->otherEnd() << " moduleName=" << fPmConnections[i]->moduleName() << endl;
}
if (tempConns.size() == fPmConnections.size()) return; fPmConnections.swap(tempConns);
pmCount = (pmCount == 0 ? 0 : pmCount - 1);
//cout << "PMCOUNT=" << pmCount << endl;
fPmConnections.swap(tempConns); // log it
pmCount = (pmCount == 0 ? 0 : pmCount - 1); ostringstream os;
//cout << "PMCOUNT=" << pmCount << endl; os << "DEC: lost connection to " << client->addr2String();
*/ writeToLog(__FILE__, __LINE__, os.str(), LOG_TYPE_CRITICAL);
// send alarm & log it */
ALARMManager alarmMgr; }
string alarmItem = client->addr2String();
alarmItem.append(" PrimProc");
alarmMgr.sendAlarmReport(alarmItem.c_str(), oam::CONN_FAILURE, SET);
ostringstream os;
os << "DEC: lost connection to " << client->addr2String();
writeToLog(__FILE__, __LINE__, os.str(), LOG_TYPE_CRITICAL);
// }
return; return;
} }
@ -999,22 +1008,22 @@ int DistributedEngineComm::writeToClient(size_t index, const ByteStream& bs, uin
catch (...) catch (...)
{ {
// @bug 488. error out under such condition instead of re-trying other connection, // @bug 488. error out under such condition instead of re-trying other connection,
// by pushing 0 size bytestream to messagequeue and throw excpetion // by pushing 0 size bytestream to messagequeue and throw exception
/* SBS sbs; SBS sbs;
lk.lock(); lk.lock();
//cout << "WARNING: DEC WRITE BROKEN PIPE. PMS index = " << index << endl; //std::cout << "WARNING: DEC WRITE BROKEN PIPE. PMS index = " << index << std::endl;
MessageQueueMap::iterator map_tok; MessageQueueMap::iterator map_tok;
sbs.reset(new ByteStream(0)); sbs.reset(new ByteStream(0));
for (map_tok = fSessionMessages.begin(); map_tok != fSessionMessages.end(); ++map_tok) for (map_tok = fSessionMessages.begin(); map_tok != fSessionMessages.end(); ++map_tok)
{ {
map_tok->second->queue.clear(); map_tok->second->queue.clear();
(void)atomicops::atomicInc(&map_tok->second->unackedWork[0]); (void)atomicops::atomicInc(&map_tok->second->unackedWork[0]);
map_tok->second->queue.push(sbs); map_tok->second->queue.push(sbs);
} }
lk.unlock();
lk.unlock();
/*
// reconfig the connection array // reconfig the connection array
ClientList tempConns; ClientList tempConns;
{ {
@ -1033,7 +1042,6 @@ int DistributedEngineComm::writeToClient(size_t index, const ByteStream& bs, uin
fPmConnections.swap(tempConns); fPmConnections.swap(tempConns);
pmCount = (pmCount == 0 ? 0 : pmCount - 1); pmCount = (pmCount == 0 ? 0 : pmCount - 1);
} }
*/
// send alarm // send alarm
ALARMManager alarmMgr; ALARMManager alarmMgr;
string alarmItem("UNKNOWN"); string alarmItem("UNKNOWN");
@ -1045,6 +1053,7 @@ int DistributedEngineComm::writeToClient(size_t index, const ByteStream& bs, uin
alarmItem.append(" PrimProc"); alarmItem.append(" PrimProc");
alarmMgr.sendAlarmReport(alarmItem.c_str(), oam::CONN_FAILURE, SET); alarmMgr.sendAlarmReport(alarmItem.c_str(), oam::CONN_FAILURE, SET);
*/
throw runtime_error("DistributedEngineComm::write: Broken Pipe error"); throw runtime_error("DistributedEngineComm::write: Broken Pipe error");
} }
} }

View File

@ -197,6 +197,12 @@ public:
return pmCount; return pmCount;
} }
unsigned getNumConnections() const
{
unsigned cpp = (fIsExeMgr ? fRm->getPsConnectionsPerPrimProc() : 1);
return fRm->getPsCount() * cpp;
}
messageqcpp::Stats getNetworkStats(uint32_t uniqueID); messageqcpp::Stats getNetworkStats(uint32_t uniqueID);
friend class ::TestDistributedEngineComm; friend class ::TestDistributedEngineComm;

View File

@ -294,24 +294,10 @@ extern "C"
try try
{ {
if (getenv("SKIP_OAM_INIT")) if (dbrm.getSystemReady()
&& dbrm.getSystemQueryReady())
{ {
if (dbrm.getSystemReady() return 1;
&& dbrm.getSystemQueryReady())
{
return 1;
}
}
else
{
oam.getSystemStatus(systemstatus);
if (systemstatus.SystemOpState == ACTIVE
&& dbrm.getSystemReady()
&& dbrm.getSystemQueryReady())
{
return 1;
}
} }
} }
catch (...) catch (...)

View File

@ -891,7 +891,11 @@ int ha_mcs_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::ca
if (current_thd->variables.sql_mode & MODE_PAD_CHAR_TO_FULL_LENGTH) if (current_thd->variables.sql_mode & MODE_PAD_CHAR_TO_FULL_LENGTH)
{ {
// Pad to the full length of the field // Pad to the full length of the field
escape.assign((char*)buf, ci.columnTypes[colpos].colWidth); if (ci.utf8)
escape.assign((char*)buf, ci.columnTypes[colpos].colWidth * 3);
else
escape.assign((char*)buf, ci.columnTypes[colpos].colWidth);
boost::replace_all(escape, "\\", "\\\\"); boost::replace_all(escape, "\\", "\\\\");
fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(), fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(),
@ -904,8 +908,10 @@ int ha_mcs_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::ca
bitmap_set_bit(table->read_set, field->field_index); bitmap_set_bit(table->read_set, field->field_index);
String attribute; String attribute;
field->val_str(&attribute); field->val_str(&attribute);
escape.assign((char*)buf, attribute.length()); escape.assign((char*)buf, attribute.length());
boost::replace_all(escape, "\\", "\\\\"); boost::replace_all(escape, "\\", "\\\\");
fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(), fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(),
escape.c_str(), ci.enclosed_by, ci.delimiter); escape.c_str(), ci.enclosed_by, ci.delimiter);
} }
@ -1777,32 +1783,35 @@ int ha_mcs_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::ca
case CalpontSystemCatalog::BLOB: case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::TEXT:
{ {
// MCOL-4005 Note that we don't handle nulls as a special
// case here as we do for other datatypes, the below works
// as expected for nulls.
uint32_t dataLength = 0; uint32_t dataLength = 0;
uintptr_t* dataptr; uintptr_t* dataptr;
uchar* ucharptr; uchar* ucharptr;
uint colWidthInBytes = (ci.utf8 ?
ci.columnTypes[colpos].colWidth * 3: ci.columnTypes[colpos].colWidth);
if (ci.columnTypes[colpos].colWidth < 256) if (colWidthInBytes < 256)
{ {
dataLength = *(uint8_t*) buf; dataLength = *(uint8_t*) buf;
buf++; buf++;
} }
else if (ci.columnTypes[colpos].colWidth < 65536) else if (colWidthInBytes < 65536)
{ {
dataLength = *(uint16_t*) buf; dataLength = *(uint16_t*) buf;
buf = buf + 2 ; buf += 2;
} }
else if (ci.columnTypes[colpos].colWidth < 16777216) else if (colWidthInBytes < 16777216)
{ {
dataLength = *(uint16_t*) buf; dataLength = *(uint16_t*) buf;
buf = buf + 2 ; dataLength |= ((int) buf[2]) << 16;
if (*(uint8_t*)buf) buf += 3;
dataLength += 256*256*(*(uint8_t*)buf) ;
buf++;
} }
else else
{ {
dataLength = *(uint32_t*) buf; dataLength = *(uint32_t*) buf;
buf = buf + 4 ; buf += 4;
} }
// buf contains pointer to blob, for example: // buf contains pointer to blob, for example:
@ -1826,7 +1835,9 @@ int ha_mcs_impl_write_batch_row_(const uchar* buf, TABLE* table, cal_impl_if::ca
else else
{ {
// TEXT Column // TEXT Column
fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, dataLength, ucharptr, ci.enclosed_by, ci.delimiter); escape.assign((char*)ucharptr, dataLength);
boost::replace_all(escape, "\\", "\\\\");
fprintf(ci.filePtr, "%c%.*s%c%c", ci.enclosed_by, (int)escape.length(), escape.c_str(), ci.enclosed_by, ci.delimiter);
} }
break; break;

View File

@ -1308,7 +1308,7 @@ uint32_t buildOuterJoin(gp_walk_info& gwi, SELECT_LEX& select_lex)
// View is already processed in view::transform // View is already processed in view::transform
// @bug5319. view is sometimes treated as derived table and // @bug5319. view is sometimes treated as derived table and
// fromSub::transform does not build outer join filters. // fromSub::transform does not build outer join filters.
if (!table_ptr->derived && table_ptr->view) if (!table_ptr->derived && table_ptr->view && !gwi.subQuery)
continue; continue;
CalpontSystemCatalog:: TableAliasName tan = make_aliasview( CalpontSystemCatalog:: TableAliasName tan = make_aliasview(

View File

@ -17,7 +17,7 @@ for arg in "$@"; do
done done
# DELETE libcalmysql.so entries first as they are in ha_columnstore.so in 1.4.2 onwards # DELETE libcalmysql.so entries first as they are in ha_columnstore.so in 1.4.2 onwards
mysql --force --user=root mysql 2> ${tmpdir}/mysql_install.log <<EOD su -s /bin/sh -c 'mysql' mysql 2> ${tmpdir}/mysql_install.log <<EOD
DELETE FROM mysql.func WHERE dl='libcalmysql.so'; DELETE FROM mysql.func WHERE dl='libcalmysql.so';
INSERT INTO mysql.func VALUES ('calgetstats',0,'ha_columnstore.so','function'); INSERT INTO mysql.func VALUES ('calgetstats',0,'ha_columnstore.so','function');
INSERT INTO mysql.func VALUES ('calsettrace',2,'ha_columnstore.so','function'); INSERT INTO mysql.func VALUES ('calsettrace',2,'ha_columnstore.so','function');
@ -110,9 +110,10 @@ CREATE TABLE IF NOT EXISTS infinidb_querystats.priority
insert ignore into infinidb_querystats.priority values ('High', 100),('Medium', 66), ('Low', 33); insert ignore into infinidb_querystats.priority values ('High', 100),('Medium', 66), ('Low', 33);
EOD EOD
mysql --user=root mysql 2>/dev/null <@ENGINE_SUPPORTDIR@/syscatalog_mysql.sql su -s /bin/sh -c 'mysql <@ENGINE_SUPPORTDIR@/syscatalog_mysql.sql' mysql 2>/dev/null
mysql --user=root mysql 2>/dev/null <@ENGINE_SUPPORTDIR@/calsetuserpriority.sql su -s /bin/sh -c 'mysql <@ENGINE_SUPPORTDIR@/calsetuserpriority.sql' mysql 2>/dev/null
mysql --user=root mysql 2>/dev/null <@ENGINE_SUPPORTDIR@/calremoveuserpriority.sql su -s /bin/sh -c 'mysql <@ENGINE_SUPPORTDIR@/calremoveuserpriority.sql' mysql 2>/dev/null
mysql --user=root mysql 2>/dev/null <@ENGINE_SUPPORTDIR@/calshowprocesslist.sql su -s /bin/sh -c 'mysql <@ENGINE_SUPPORTDIR@/calshowprocesslist.sql' mysql 2>/dev/null
mysql --user=root mysql 2>/dev/null <@ENGINE_SUPPORTDIR@/columnstore_info.sql su -s /bin/sh -c 'mysql <@ENGINE_SUPPORTDIR@/columnstore_info.sql' mysql 2>/dev/null

View File

@ -644,7 +644,11 @@ new_plan:
std::cout << "### For session id " << csep.sessionID() << ", got a CSEP" << std::endl; std::cout << "### For session id " << csep.sessionID() << ", got a CSEP" << std::endl;
setRMParms(csep.rmParms()); setRMParms(csep.rmParms());
// Re-establish lost PP connections.
if (UNLIKELY(fEc->getNumConnections() != fEc->connectedPmServers()))
{
fEc->Setup();
}
// @bug 1021. try to get schema cache for a come in query. // @bug 1021. try to get schema cache for a come in query.
// skip system catalog queries. // skip system catalog queries.
if (!csep.isInternal()) if (!csep.isInternal())
@ -1647,7 +1651,7 @@ int main(int argc, char* argv[])
{ {
} }
} }
if (getenv("SKIP_OAM_INIT"))
{ {
BRM::DBRM *dbrm = new BRM::DBRM(); BRM::DBRM *dbrm = new BRM::DBRM();
dbrm->setSystemQueryReady(true); dbrm->setSystemQueryReady(true);

View File

@ -6,6 +6,8 @@
--> -->
<ClusterManager>0.0.0.0</ClusterManager> <ClusterManager>0.0.0.0</ClusterManager>
<ConfigRevision>1</ConfigRevision> <ConfigRevision>1</ConfigRevision>
<NextNodeId>2</NextNodeId>
<NextDBRootId>2</NextDBRootId>
<ExeMgr1> <ExeMgr1>
<IPAddr>127.0.0.1</IPAddr> <IPAddr>127.0.0.1</IPAddr>
<Port>8601</Port> <Port>8601</Port>
@ -246,7 +248,7 @@
<DBRoot1>/var/lib/columnstore/data1</DBRoot1> <DBRoot1>/var/lib/columnstore/data1</DBRoot1>
<DBRMRoot>/var/lib/columnstore/data1/systemFiles/dbrm/BRM_saves</DBRMRoot> <DBRMRoot>/var/lib/columnstore/data1/systemFiles/dbrm/BRM_saves</DBRMRoot>
<TableLockSaveFile>/var/lib/columnstore/data1/systemFiles/dbrm/tablelocks</TableLockSaveFile> <TableLockSaveFile>/var/lib/columnstore/data1/systemFiles/dbrm/tablelocks</TableLockSaveFile>
<DBRMTimeOut>20</DBRMTimeOut> <!-- in seconds --> <DBRMTimeOut>15</DBRMTimeOut> <!-- in seconds -->
<DBRMSnapshotInterval>100000</DBRMSnapshotInterval> <DBRMSnapshotInterval>100000</DBRMSnapshotInterval>
<ExternalCriticalThreshold>90</ExternalCriticalThreshold> <ExternalCriticalThreshold>90</ExternalCriticalThreshold>
<ExternalMajorThreshold>80</ExternalMajorThreshold> <ExternalMajorThreshold>80</ExternalMajorThreshold>

View File

@ -20,6 +20,7 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-writeengineserver.service.in" "$
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-dmlproc.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-dmlproc.service" @ONLY) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-dmlproc.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-dmlproc.service" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-ddlproc.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-ddlproc.service" @ONLY) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-ddlproc.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-ddlproc.service" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.service" @ONLY) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.service.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-loadbrm.service" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/mcs-stop-controllernode.sh.in" "${CMAKE_CURRENT_SOURCE_DIR}/mcs-stop-controllernode.sh" @ONLY)
install(PROGRAMS columnstore-post-install install(PROGRAMS columnstore-post-install
columnstore-pre-uninstall columnstore-pre-uninstall
@ -42,6 +43,7 @@ install(PROGRAMS columnstore-post-install
disable-rep-columnstore.sh disable-rep-columnstore.sh
mariadb-command-line.sh mariadb-command-line.sh
mcs_module_installer.sh mcs_module_installer.sh
mcs-stop-controllernode.sh
DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine) DESTINATION ${ENGINE_BINDIR} COMPONENT columnstore-engine)
install(FILES mariadb-columnstore.service install(FILES mariadb-columnstore.service

View File

@ -4,11 +4,33 @@
# #
# Post-install steps for columnstore install # Post-install steps for columnstore install
running_systemd() {
if [ "$(ps --no-headers -o comm 1)" == "systemd" ]; then
echo 0
else
echo 1
fi
}
rpmmode=install rpmmode=install
user=`whoami 2>/dev/null` user=`whoami 2>/dev/null`
quiet=0 quiet=0
stop_mysqld=0
if [ -z "$(pgrep -x mysqld)" ];then
# Startup mysqld
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
systemctl start mariadb.service
else
/usr/bin/mysqld_safe &
fi
stop_mysqld=1
fi
sleep 2
if [ -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave ]; then if [ -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave ]; then
/bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.new /bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.new
/bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf /bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf
@ -60,70 +82,70 @@ mkdir /mnt/tmp > /dev/null 2>&1
if [ $user = "root" ]; then if [ $user = "root" ]; then
#setup the columnstore service script #setup the columnstore service script
rm -f /etc/init.d/columnstore >/dev/null 2>&1 rm -f /etc/init.d/columnstore >/dev/null 2>&1
rm -f /etc/default/columnstore rm -f /etc/default/columnstore
systemctl=`which systemctl 2>/dev/null` systemctl=`which systemctl 2>/dev/null`
if [ -n "$systemctl" ]; then if [ -n "$systemctl" ]; then
cp @ENGINE_SUPPORTDIR@/mariadb-columnstore.service /usr/lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mariadb-columnstore.service /usr/lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mariadb-columnstore.service /lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mariadb-columnstore.service /lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-controllernode.service /usr/lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-controllernode.service /usr/lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-controllernode.service /lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-controllernode.service /lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-ddlproc.service /usr/lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-ddlproc.service /usr/lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-ddlproc.service /lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-ddlproc.service /lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-dmlproc.service /usr/lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-dmlproc.service /usr/lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-dmlproc.service /lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-dmlproc.service /lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-exemgr.service /usr/lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-exemgr.service /usr/lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-exemgr.service /lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-exemgr.service /lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-primproc.service /usr/lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-primproc.service /usr/lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-primproc.service /lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-primproc.service /lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-workernode.service /usr/lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-workernode.service /usr/lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-workernode.service /lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-workernode.service /lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-writeengineserver.service /usr/lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-writeengineserver.service /usr/lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-writeengineserver.service /lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-writeengineserver.service /lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-loadbrm.service /usr/lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-loadbrm.service /usr/lib/systemd/system/. >/dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/mcs-loadbrm.service /lib/systemd/system/. >/dev/null 2>&1 cp @ENGINE_SUPPORTDIR@/mcs-loadbrm.service /lib/systemd/system/. >/dev/null 2>&1
systemctl enable mariadb-columnstore >/dev/null 2>&1 systemctl enable mariadb-columnstore >/dev/null 2>&1
systemctl enable mcs-controllernode > /dev/null 2>&1 systemctl enable mcs-controllernode > /dev/null 2>&1
systemctl enable mcs-ddlproc > /dev/null 2>&1 systemctl enable mcs-ddlproc > /dev/null 2>&1
systemctl enable mcs-dmlproc > /dev/null 2>&1 systemctl enable mcs-dmlproc > /dev/null 2>&1
systemctl enable mcs-exemgr > /dev/null 2>&1 systemctl enable mcs-exemgr > /dev/null 2>&1
systemctl enable mcs-primproc > /dev/null 2>&1 systemctl enable mcs-primproc > /dev/null 2>&1
systemctl enable mcs-workernode > /dev/null 2>&1 systemctl enable mcs-workernode > /dev/null 2>&1
systemctl enable mcs-writeengineserver > /dev/null 2>&1 systemctl enable mcs-writeengineserver > /dev/null 2>&1
systemctl enable mcs-loadbrm > /dev/null 2>&1 systemctl enable mcs-loadbrm > /dev/null 2>&1
else else
chkconfig=`which chkconfig 2>/dev/null` chkconfig=`which chkconfig 2>/dev/null`
if [ -n "$chkconfig" ]; then if [ -n "$chkconfig" ]; then
cp @ENGINE_SBINDIR@/columnstore /etc/init.d/. >/dev/null 2>&1 cp @ENGINE_SBINDIR@/columnstore /etc/init.d/. >/dev/null 2>&1
chkconfig --add columnstore > /dev/null 2>&1 chkconfig --add columnstore > /dev/null 2>&1
chkconfig columnstore on > /dev/null 2>&1 chkconfig columnstore on > /dev/null 2>&1
else else
cp @ENGINE_SBINDIR@/columnstore /etc/init.d/. >/dev/null 2>&1 cp @ENGINE_SBINDIR@/columnstore /etc/init.d/. >/dev/null 2>&1
updaterc=`which update-rc.d 2>/dev/null` updaterc=`which update-rc.d 2>/dev/null`
if [ -n "$updaterc" ]; then if [ -n "$updaterc" ]; then
update-rc.d columnstore defaults 99 > /dev/null 2>&1 update-rc.d columnstore defaults 99 > /dev/null 2>&1
else else
echo "" echo ""
echo "Package 'systemctl', 'chkconfig' or 'update-rc.d' not installed, contact your sysadmin if you want to setup to autostart for columnstore" echo "Package 'systemctl', 'chkconfig' or 'update-rc.d' not installed, contact your sysadmin if you want to setup to autostart for columnstore"
fi fi
fi fi
fi fi
fi fi
if [ $user = "root" ]; then if [ $user = "root" ]; then
columnstoreSyslogSetup.sh install > $tmpDir/syslog_install.log 2>&1 columnstoreSyslogSetup.sh install > $tmpDir/syslog_install.log 2>&1
#check if MariaDB Columnstore system logging was setup #check if MariaDB Columnstore system logging was setup
cat $tmpDir/syslog_install.log | grep 'No System Logging' >/dev/null 2>&1 cat $tmpDir/syslog_install.log | grep 'No System Logging' >/dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
cat $tmpDir/syslog_install.log cat $tmpDir/syslog_install.log
fi fi
else else
chown $user:$user @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml chown $user:$user @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml
cat <<EOD cat <<EOD
@ -151,17 +173,29 @@ rm -f $lockdir/columnstore
#check and get amazon env variables #check and get amazon env variables
aws=`which aws 2>/dev/null` aws=`which aws 2>/dev/null`
if [ -z "aws" ]; then if [ -z "aws" ]; then
MCSgetCredentials.sh >/dev/null 2>&1 MCSgetCredentials.sh >/dev/null 2>&1
fi fi
postConfigure postConfigure
systemctl start mariadb-columnstore systemctl start mariadb-columnstore
while [ -z $(pgrep -x controllernode) ]; # Wait for all columnstore to be ready, DDLProc is final process in startup order
while [ -z "$(pgrep -x DDLProc)" ];
do do
sleep 2 sleep 1
done done
dbbuilder 7 > $tmpDir/dbbuilder.log dbbuilder 7 > $tmpDir/dbbuilder.log
exit 0
if [ $stop_mysqld -eq 1 ];then
# Make sure we stop mariadb since it wasn't running prior to columnstore installation
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
systemctl stop mariadb.service > /dev/null 2>&1
else
pkill mysqld
fi
fi
sleep 2
exit 0

View File

@ -10,7 +10,6 @@ running_systemd() {
else else
echo 1 echo 1
fi fi
} }
# Test we are using systemd # Test we are using systemd
@ -22,29 +21,32 @@ else
kill $(pidof $PROGS) > /dev/null kill $(pidof $PROGS) > /dev/null
sleep 3 sleep 3
kill -9 $(pidof $PROGS) > /dev/null kill -9 $(pidof $PROGS) > /dev/null
clearShm > /dev/null 2>&1
fi
if [ -n "$(pgrep -x ProcMon)" ] || [ -n "$(pgrep -x ProcMgr)" ];then
# Old system must be running, kill ProcMon/ProcMgr
pkill ProcMon
pkill ProcMgr
fi fi
rm -f /etc/profile.d/columnstoreAlias.sh rm -f /etc/profile.d/columnstoreAlias.sh
rm -f /var/log/mariadb/columnstore/activeAlarms > /dev/null 2>&1 rm -f /var/log/mariadb/columnstore/activeAlarms > /dev/null 2>&1
rm -f /var/log/mariadb/columnstore/*.log1 > /dev/null 2>&1 rm -f /var/log/mariadb/columnstore/*.log1 > /dev/null 2>&1
# delete Mariab Columnstore shared memory segments
clearShm > /dev/null 2>&1
#get temp directory #get temp directory
tmpDir=`mcsGetConfig SystemConfig SystemTempFileDir` tmpDir=`mcsGetConfig SystemConfig SystemTempFileDir`
if [[ $tmpDir = *"tmp" ]]; then if [[ $tmpDir = *"tmp" ]]; then
# delete tmp files # delete tmp files
rm -rf $tmpDir/* rm -rf $tmpDir/*
fi fi
rm -f /var/lib/columnstore/local/*.columnstore rm -f /var/lib/columnstore/local/*.columnstore
rm -rf /var/lib/columnstore/local/etc/ rm -rf /var/lib/columnstore/local/etc/
rm -f /var/lib/columnstore/data/bulk/tmp/job/* >/dev/null 2>&1 rm -f /var/lib/columnstore/data/bulk/tmp/job/* >/dev/null 2>&1
rm -f /var/lib/columnstore/local/moveDbrootTransactionLog rm -f /var/lib/columnstore/local/moveDbrootTransactionLog
rm -rf /var/log/mariadb/columnstore/ rm -rf /var/log/mariadb/columnstore/
rm -rf /tmp/columnstore_tmp_files rm -rf /tmp/columnstore_tmp_files
rm -rf /usr/share/columnstore
lockdir=`mcsGetConfig Installation LockFileDirectory` lockdir=`mcsGetConfig Installation LockFileDirectory`
rm -f $lockdir/columnstore rm -f $lockdir/columnstore
@ -69,45 +71,44 @@ if [ -n "$systemctl" ] && [ $(running_systemd) -eq 0 ]; then
systemctl disable mcs-writeengineserver > /dev/null 2>&1 systemctl disable mcs-writeengineserver > /dev/null 2>&1
systemctl disable mcs-loadbrm > /dev/null 2>&1 systemctl disable mcs-loadbrm > /dev/null 2>&1
rm -f /usr/lib/systemd/system/mariadb-columnstore.service rm -f /usr/lib/systemd/system/mariadb-columnstore.service
rm -f /lib/systemd/system/mariadb-columnstore.service rm -f /lib/systemd/system/mariadb-columnstore.service
rm -f /usr/lib/systemd/system/mcs-controllernode.service rm -f /usr/lib/systemd/system/mcs-controllernode.service
rm -f /lib/systemd/system/mcs-controllernode.service rm -f /lib/systemd/system/mcs-controllernode.service
rm -f /usr/lib/systemd/system/mcs-ddlproc.service rm -f /usr/lib/systemd/system/mcs-ddlproc.service
rm -f /lib/systemd/system/mcs-ddlproc.service rm -f /lib/systemd/system/mcs-ddlproc.service
rm -f /usr/lib/systemd/system/mcs-dmlproc.service rm -f /usr/lib/systemd/system/mcs-dmlproc.service
rm -f /lib/systemd/system/mcs-dmlproc.service rm -f /lib/systemd/system/mcs-dmlproc.service
rm -f /usr/lib/systemd/system/mcs-exemgr.service rm -f /usr/lib/systemd/system/mcs-exemgr.service
rm -f /lib/systemd/system/mcs-exemgr.service rm -f /lib/systemd/system/mcs-exemgr.service
rm -f /usr/lib/systemd/system/mcs-primproc.service rm -f /usr/lib/systemd/system/mcs-primproc.service
rm -f /lib/systemd/system/mcs-primproc.service rm -f /lib/systemd/system/mcs-primproc.service
rm -f /usr/lib/systemd/system/mcs-workernode.service rm -f /usr/lib/systemd/system/mcs-workernode.service
rm -f /lib/systemd/system/mcs-workernode.service rm -f /lib/systemd/system/mcs-workernode.service
rm -f /usr/lib/systemd/system/mcs-writeengineserver.service rm -f /usr/lib/systemd/system/mcs-writeengineserver.service
rm -f /lib/systemd/system/mcs-writeengineserver.service rm -f /lib/systemd/system/mcs-writeengineserver.service
rm -f /usr/lib/systemd/system/mcs-loadbrm.service rm -f /usr/lib/systemd/system/mcs-loadbrm.service
rm -f /lib/systemd/system/mcs-loadbrm.service rm -f /lib/systemd/system/mcs-loadbrm.service
systemctl daemon-reload systemctl daemon-reload
else else
chkconfig=`which chkconfig 2>/dev/null` chkconfig=`which chkconfig 2>/dev/null`
if [ -n "$chkconfig" ]; then if [ -n "$chkconfig" ]; then
chkconfig columnstore off > /dev/null 2>&1 chkconfig columnstore off > /dev/null 2>&1
chkconfig --del columnstore > /dev/null 2>&1 chkconfig --del columnstore > /dev/null 2>&1
rm -f /etc/init.d/columnstore > /dev/null 2>&1 rm -f /etc/init.d/columnstore > /dev/null 2>&1
else else
updaterc=`which update-rc.d 2>/dev/null` updaterc=`which update-rc.d 2>/dev/null`
if [ -n "$updaterc" ]; then if [ -n "$updaterc" ]; then
update-rc.d -f columnstore remove > /dev/null 2>&1 update-rc.d -f columnstore remove > /dev/null 2>&1
rm -f /etc/init.d/columnstore > /dev/null 2>&1 rm -f /etc/init.d/columnstore > /dev/null 2>&1
fi fi
fi fi
fi fi
#make copy of Columnstore.xml #make copy of Columnstore.xml
/bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml.rpmsave > /dev/null 2>&1 /bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml @ENGINE_SYSCONFDIR@/columnstore/Columnstore.xml.rpmsave > /dev/null 2>&1
/bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave > /dev/null 2>&1 /bin/cp -f @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf @ENGINE_SYSCONFDIR@/columnstore/storagemanager.cnf.rpmsave > /dev/null 2>&1
/bin/cp -f @MARIADB_MYCNFDIR@/columnstore.cnf @MARIADB_MYCNFDIR@/columnstore.cnf.rpmsave > /dev/null 2>&1 /bin/cp -f @MARIADB_MYCNFDIR@/columnstore.cnf @MARIADB_MYCNFDIR@/columnstore.cnf.rpmsave > /dev/null 2>&1
cp @ENGINE_SUPPORTDIR@/myCnf-include-args.text @ENGINE_SUPPORTDIR@/myCnf-include-args.text.rpmsave >& /dev/null
rm -f @ENGINE_SYSCONFDIR@/columnstore/AlarmConfig.xml.installSave rm -f @ENGINE_SYSCONFDIR@/columnstore/AlarmConfig.xml.installSave
#remove OAMdbrootCheck file #remove OAMdbrootCheck file

View File

@ -8,7 +8,7 @@ Type=forking
Environment="SKIP_OAM_INIT=1" Environment="SKIP_OAM_INIT=1"
ExecStart=@ENGINE_BINDIR@/controllernode ExecStart=@ENGINE_BINDIR@/controllernode
Restart=on-failure Restart=on-failure
ExecStop=/usr/bin/env bash -c "/bin/kill -15 $MAINPID && sleep 2 && /bin/kill -9 $(pidof controllernode) || /bin/true" ExecStop=@ENGINE_BINDIR@/mcs-stop-controllernode.sh $MAINPID
[Install] [Install]
WantedBy=mariadb-columnstore.service WantedBy=mariadb-columnstore.service

View File

@ -1,6 +1,6 @@
[Unit] [Unit]
Description=mcs-ddlproc Description=mcs-ddlproc
PartOf=mcs-writeengineserver.service PartOf=mcs-exemgr.service
After=mcs-dmlproc.service After=mcs-dmlproc.service
[Service] [Service]
@ -8,7 +8,7 @@ Type=simple
Environment="SKIP_OAM_INIT=1" Environment="SKIP_OAM_INIT=1"
ExecStart=@ENGINE_BINDIR@/DDLProc ExecStart=@ENGINE_BINDIR@/DDLProc
Restart=on-failure Restart=on-failure
ExecStop=/usr/bin/env bash -c "/bin/kill -15 $(pidof DDLProc) && sleep 2 && /bin/kill -9 $(pidof DDLProc) || /bin/true" TimeoutStopSec=2
[Install] [Install]
WantedBy=mariadb-columnstore.service WantedBy=mariadb-columnstore.service

View File

@ -1,14 +1,14 @@
[Unit] [Unit]
Description=mcs-dmlproc Description=mcs-dmlproc
PartOf=mcs-writeengineserver.service PartOf=mcs-exemgr.service
After=mcs-writeengineserver.service After=mcs-exemgr.service
[Service] [Service]
Type=simple Type=simple
Environment="SKIP_OAM_INIT=1" Environment="SKIP_OAM_INIT=1"
ExecStart=@ENGINE_BINDIR@/DMLProc ExecStart=@ENGINE_BINDIR@/DMLProc
Restart=on-failure Restart=on-failure
ExecStop=/usr/bin/env bash -c "/bin/kill -15 $(pidof DMLProc) && sleep 2 && /bin/kill -9 $(pidof DMLProc) || /bin/true" TimeoutStopSec=2
[Install] [Install]
WantedBy=mariadb-columnstore.service WantedBy=mariadb-columnstore.service

View File

@ -1,14 +1,14 @@
[Unit] [Unit]
Description=mcs-exemgr Description=mcs-exemgr
PartOf=mcs-controllernode.service PartOf=mcs-writeengineserver.service
After=mcs-controllernode.service After=mcs-writeengineserver.service
[Service] [Service]
Type=simple Type=simple
Environment="SKIP_OAM_INIT=1" Environment="SKIP_OAM_INIT=1"
ExecStart=@ENGINE_BINDIR@/ExeMgr ExecStart=@ENGINE_BINDIR@/ExeMgr
Restart=on-failure Restart=on-failure
ExecStop=/usr/bin/env bash -c "/bin/kill -15 $(pidof ExeMgr) && sleep 2 && /bin/kill -9 $(pidof ExeMgr) || /bin/true" TimeoutStopSec=2
[Install] [Install]
WantedBy=mariadb-columnstore.service WantedBy=mariadb-columnstore.service

View File

@ -1,14 +1,15 @@
[Unit] [Unit]
Description=mcs-primproc Description=mcs-primproc
PartOf=mcs-exemgr.service PartOf=mcs-workernode.service
After=mcs-exemgr.service PartOf=mcs-controllernode.service
After=mcs-controllernode.service
[Service] [Service]
Type=simple Type=simple
Environment="SKIP_OAM_INIT=1" Environment="SKIP_OAM_INIT=1"
ExecStart=@ENGINE_BINDIR@/PrimProc ExecStart=@ENGINE_BINDIR@/PrimProc
Restart=on-failure Restart=on-failure
ExecStop=/usr/bin/env bash -c "/bin/kill -15 $(pidof PrimProc) && sleep 2 && /bin/kill -9 $(pidof PrimProc) || /bin/true" TimeoutStopSec=2
[Install] [Install]
WantedBy=mariadb-columnstore.service WantedBy=mariadb-columnstore.service

View File

@ -0,0 +1,15 @@
#!/bin/bash
/bin/kill -15 "$1"
systemctl stop mcs-workernode --ignore-dependencies
timeout=$(mcsGetConfig SystemConfig DBRMTimeout)
while [ -n "$(pgrep -x controllernode)" ] && [ $timeout -gt 0 ]
do
sleep 1
((--timeout))
done
if [ -n "$(pgrep -x controllernode)" ]; then
/bin/kill -9 "$1"
fi

View File

@ -9,8 +9,8 @@ Environment="SKIP_OAM_INIT=1"
ExecStart=@ENGINE_BINDIR@/workernode DBRM_Worker1 ExecStart=@ENGINE_BINDIR@/workernode DBRM_Worker1
Restart=on-failure Restart=on-failure
ExecStop=-@ENGINE_BINDIR@/save_brm ExecStop=-@ENGINE_BINDIR@/save_brm
ExecStop=/usr/bin/env bash -c "/bin/kill -15 $MAINPID && sleep 2 && /bin/kill -9 $(pidof workernode) || /bin/true"
ExecStopPost=/usr/bin/env bash -c "clearShm > /dev/null 2>&1" ExecStopPost=/usr/bin/env bash -c "clearShm > /dev/null 2>&1"
TimeoutStopSec=2
[Install] [Install]
WantedBy=mariadb-columnstore.service WantedBy=mariadb-columnstore.service

View File

@ -1,14 +1,14 @@
[Unit] [Unit]
Description=WriteEngineServer Description=WriteEngineServer
PartOf=mcs-exemgr.service PartOf=mcs-primproc.service
After=mcs-exemgr.service After=mcs-primproc.service
[Service] [Service]
Type=simple Type=simple
Environment="SKIP_OAM_INIT=1" Environment="SKIP_OAM_INIT=1"
ExecStart=@ENGINE_BINDIR@/WriteEngineServer ExecStart=@ENGINE_BINDIR@/WriteEngineServer
Restart=on-failure Restart=on-failure
ExecStop=/usr/bin/env bash -c "/bin/kill -15 $(pidof WriteEngineServer) && sleep 2 && /bin/kill -9 $(pidof WriteEngineServer) || /bin/true" TimeoutStopSec=2
[Install] [Install]
WantedBy=mariadb-columnstore.service WantedBy=mariadb-columnstore.service

View File

@ -5,13 +5,6 @@
# Post-install steps for calpont-mysql install # Post-install steps for calpont-mysql install
# check if running systemd # check if running systemd
running_systemd() {
if [ "$(ps --no-headers -o comm 1)" == "systemd" ]; then
echo 0
else
echo 1
fi
}
# check log for error # check log for error
checkForError() { checkForError() {
@ -63,20 +56,6 @@ done
# Install various Calpont stuff... # Install various Calpont stuff...
install_mcs_mysql.sh --tmpdir=$tmpdir install_mcs_mysql.sh --tmpdir=$tmpdir
# Restart MariDB, otherwise engine does not show up.
# Test we are using systemd
systemctl cat mariadb.service > /dev/null 2>&1
if [ $? -eq 0 ] && [ $(running_systemd) -eq 0 ]; then
systemctl restart mariadb.service > /dev/null 2>&1
else
pkill mysqld
sleep 2
export MYSQL_OPTS="--skip-grant-tables"
/usr/bin/mysqld_safe --skip-grant-tables &
unset MYSQL_OPTS
fi
sleep 5
checkForError checkForError
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing" echo "ERROR: Invalid password in .my.cnf, or Columnstore plugin install missing"

View File

@ -2371,9 +2371,9 @@ void Oam::setProcessStatus(const std::string process, const std::string module,
void Oam::processInitComplete(std::string processName, int state) void Oam::processInitComplete(std::string processName, int state)
{ {
//This method takes too long on Windows and doesn't do anything there anyway... //This method takes too long on Windows and doesn't do anything there anyway...
if (getenv("SKIP_OAM_INIT") != NULL) // Disable legacy OAM
return; return;
// get current Module name // get current Module name
string moduleName; string moduleName;
oamModuleInfo_t st; oamModuleInfo_t st;

View File

@ -111,6 +111,8 @@ void OamCache::checkReload()
// Restore for Windows when we support multiple PMs // Restore for Windows when we support multiple PMs
while (it != uniquePids.end()) while (it != uniquePids.end())
{ {
// Disable legacy-OAM.
/*
if (getenv("SKIP_OAM_INIT") == NULL) if (getenv("SKIP_OAM_INIT") == NULL)
{ {
try try
@ -182,6 +184,7 @@ void OamCache::checkReload()
} }
} }
else else
*/
{ {
pmToConnectionMap[*it] = i++; pmToConnectionMap[*it] = i++;
moduleIds.push_back(*it); moduleIds.push_back(*it);

View File

@ -174,10 +174,8 @@ void setupSignalHandlers()
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
// print a warning if this is a developer build
if (getenv("SKIP_OAM_INIT"))
{ {
cout << "SKIP_OAM_INIT is set" << endl; cout << "SKIP_OAM_INIT is set and legacy OAM is disabled by default" << endl;
sleep(2); sleep(2);
} }

View File

@ -250,14 +250,12 @@ void mysqlSetup()
{ {
Oam oam; Oam oam;
string cmd; string cmd;
string tmpDir = startup::StartUp::tmpDir();
string tmpDir = startup::StartUp::tmpDir();
string mysqlpw = oam.getMySQLPassword(); string mysqlpw = oam.getMySQLPassword();
string passwordOption = "";
string passwordOption = "";
if ( mysqlpw != oam::UnassignedName ) if ( mysqlpw != oam::UnassignedName )
passwordOption = " --password=" + mysqlpw; passwordOption = " --password=" + mysqlpw;
cmd = "post-mysqld-install " + passwordOption + " --tmpdir=" + tmpDir + " > " + tmpDir + "/post-mysqld-install.log 2>&1"; cmd = "post-mysqld-install " + passwordOption + " --tmpdir=" + tmpDir + " > " + tmpDir + "/post-mysqld-install.log 2>&1";
int rtnCode = system(cmd.c_str()); int rtnCode = system(cmd.c_str());

View File

@ -89,13 +89,8 @@ int main(int argc, char* argv[])
string cmd; string cmd;
string numBlocksPctParam = ""; string numBlocksPctParam = "";
string totalUmMemoryParam = ""; string totalUmMemoryParam = "";
string reuseConfig = "n";
string mysqlPort = "";
string homeDir = "/root"; string homeDir = "/root";
bool rootUser = true; bool rootUser = true;
Config* sysConfig = Config::makeConfig();
mysqlPort = sysConfig->getConfig("Installation", "MySQLPort");
//check if root-user //check if root-user
int user; int user;
@ -122,15 +117,11 @@ int main(int argc, char* argv[])
char timestamp[200]; char timestamp[200];
strftime (timestamp, 200, "%m:%d:%y-%H:%M:%S", &tm); strftime (timestamp, 200, "%m:%d:%y-%H:%M:%S", &tm);
string currentDate = timestamp; string currentDate = timestamp;
string postConfigureLog = "/var/log/columnstore-postconfigure-" + currentDate; string postConfigureLog = "/var/log/columnstore-postconfigure-" + currentDate;
// perform single server install // perform single server install
cout << endl << "Performing the Single Server Install." << endl << endl; cout << endl << "Performing the Single Server Install." << endl << endl;
//setup to Columnstore.xml file for single server
//singleServerConfigSetup(sysConfig);
if (!rootUser) if (!rootUser)
{ {
if (!updateBash(homeDir)) if (!updateBash(homeDir))
@ -147,7 +138,7 @@ int main(int argc, char* argv[])
totalUmMemoryParam = "-"; totalUmMemoryParam = "-";
} }
cmd = "columnstore_installer dummy.rpm dummy.rpm dummy.rpm dummy.rpm dummy.rpm initial dummy " + reuseConfig + " --nodeps ' ' 1 " + numBlocksPctParam + " " + totalUmMemoryParam; cmd = "columnstore_installer dummy.rpm dummy.rpm dummy.rpm dummy.rpm dummy.rpm initial dummy n --nodeps ' ' 1 " + numBlocksPctParam + " " + totalUmMemoryParam;
system(cmd.c_str()); system(cmd.c_str());
exit(0); exit(0);
} }

View File

@ -617,7 +617,8 @@ int RedistributeControlThread::executeRedistributePlan()
{ {
try try
{ {
// skip system status check in case no OAM // skip system status check in case no OAM
/*
if (getenv("SKIP_OAM_INIT") == NULL) if (getenv("SKIP_OAM_INIT") == NULL)
{ {
// make sure system is in active state // make sure system is in active state
@ -646,6 +647,7 @@ int RedistributeControlThread::executeRedistributePlan()
sleep(1);; sleep(1);;
} }
} }
*/
if (fStopAction) if (fStopAction)
return RED_EC_USER_STOP; return RED_EC_USER_STOP;

View File

@ -542,7 +542,7 @@ void WESDHandler::setup()
} }
// getModuleStatus will take too long. Also to test in development // getModuleStatus will take too long. Also to test in development
if (getenv("SKIP_OAM_INIT") == NULL) /* if (getenv("SKIP_OAM_INIT") == NULL)
{ {
vector<unsigned int>& aVec = fRef.fCmdArgs.getPmVec(); vector<unsigned int>& aVec = fRef.fCmdArgs.getPmVec();
@ -573,6 +573,7 @@ void WESDHandler::setup()
} }
} }
} }
*/
int rtn = fDbrm.getSystemReady(); int rtn = fDbrm.getSystemReady();