diff --git a/.drone.jsonnet b/.drone.jsonnet index 49c30e522..b63b93bd3 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -113,7 +113,7 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.9') = { local config_path_prefix = if (pkg_format == 'rpm') then '/etc/my.cnf.d/' else '/etc/mysql/mariadb.conf.d/50-', local img = if (platform == 'centos:7' || std.split(platform, ':')[0] == 'rockylinux') then platform else 'romcheck/' + std.strReplace(platform, '/', '-'), local regression_ref = if (std.split(branch, '-')[0] == 'develop') then branch else 'develop-6', - local regression_tests = if (std.startsWith(platform, 'debian') || std.startsWith(platform, 'ubuntu:20')) then 'test000.sh,test001.sh' else 'test000.sh,test001.sh', + local regression_tests = if (std.startsWith(platform, 'debian') || std.startsWith(platform, 'ubuntu:20')) then 'test000.sh' else 'test000.sh,test001.sh', local branchp = if (branch == '**') then '' else branch, local result = std.strReplace(std.strReplace(platform, ':', ''), '/', '-'), diff --git a/dbcon/ddlpackageproc/createtableprocessor.cpp b/dbcon/ddlpackageproc/createtableprocessor.cpp index ee56d20a4..3d3bf4214 100644 --- a/dbcon/ddlpackageproc/createtableprocessor.cpp +++ b/dbcon/ddlpackageproc/createtableprocessor.cpp @@ -607,7 +607,6 @@ keepGoing: ++iter; } - // TODO MCOL-5021 compressionType is hardcoded to 2 (SNAPPY) bytestream << (fStartingColOID + size); bytestream << (uint8_t)execplan::AUX_COL_DATATYPE; bytestream << (uint8_t) false; diff --git a/dbcon/ddlpackageproc/droptableprocessor.cpp b/dbcon/ddlpackageproc/droptableprocessor.cpp index 183b2ad2d..e627fc8d4 100644 --- a/dbcon/ddlpackageproc/droptableprocessor.cpp +++ b/dbcon/ddlpackageproc/droptableprocessor.cpp @@ -146,7 +146,15 @@ DropTableProcessor::DDLResult DropTableProcessor::processPackage( try { roPair = systemCatalogPtr->tableRID(tableName); - tableAUXColOid = systemCatalogPtr->tableAUXColumnOID(tableName); + + if (tableName.schema.compare(execplan::CALPONT_SCHEMA) == 0) + { + tableAUXColOid = 0; + } + else + { + tableAUXColOid = systemCatalogPtr->tableAUXColumnOID(tableName); + } } catch (IDBExcept& ie) { diff --git a/dbcon/execplan/calpontsystemcatalog.cpp b/dbcon/execplan/calpontsystemcatalog.cpp index bde2ad5cb..54f8953fe 100644 --- a/dbcon/execplan/calpontsystemcatalog.cpp +++ b/dbcon/execplan/calpontsystemcatalog.cpp @@ -3755,6 +3755,16 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::isAUXColumnOID(const OID& oid) checkSysCatVer(); + boost::mutex::scoped_lock lk1(fAUXColumnOIDToTableOIDMapLock); + AUXColumnOIDTableOIDmap::const_iterator iter = fAUXColumnOIDToTableOIDMap.find(oid); + + if (iter != fAUXColumnOIDToTableOIDMap.end()) + { + return iter->second; + } + + lk1.unlock(); + // select objectid from systable where auxcolumnoid = oid; CalpontSelectExecutionPlan csep; CalpontSelectExecutionPlan::ReturnedColumnList returnedColumnList; @@ -3818,7 +3828,10 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::isAUXColumnOID(const OID& oid) { if ((*it)->dataCount() == 1) { - return (OID)((*it)->GetData(0)); + // populate cache + lk1.lock(); + fAUXColumnOIDToTableOIDMap[oid] = (OID)((*it)->GetData(0)); + return fAUXColumnOIDToTableOIDMap[oid]; } else { @@ -3827,7 +3840,10 @@ CalpontSystemCatalog::OID CalpontSystemCatalog::isAUXColumnOID(const OID& oid) } } - return (OID)(0); + // populate cache + lk1.lock(); + fAUXColumnOIDToTableOIDMap[oid] = 0; + return fAUXColumnOIDToTableOIDMap[oid]; } #if 0 @@ -5871,6 +5887,10 @@ void CalpontSystemCatalog::flushCache() fTableAUXColumnOIDMap.clear(); auxlk.unlock(); + boost::mutex::scoped_lock auxtotableoidlk(fAUXColumnOIDToTableOIDMapLock); + fAUXColumnOIDToTableOIDMap.clear(); + auxtotableoidlk.unlock(); + boost::recursive_mutex::scoped_lock lk4(fDctTokenMapLock); fDctTokenMap.clear(); buildSysDctmap(); diff --git a/dbcon/execplan/calpontsystemcatalog.h b/dbcon/execplan/calpontsystemcatalog.h index cd8347022..1cb0921d2 100644 --- a/dbcon/execplan/calpontsystemcatalog.h +++ b/dbcon/execplan/calpontsystemcatalog.h @@ -647,7 +647,6 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog */ const ROPair columnRID(const TableColName& tableColName, int lower_case_table_names = 0); - // TODO MCOL-5021 /** return the RID's of the columns for a table * * returns a list of the RID's of the columns for a table @@ -879,6 +878,10 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog TableOIDmap fTableAUXColumnOIDMap; boost::mutex fTableAUXColumnOIDMapLock; + typedef std::map AUXColumnOIDTableOIDmap; + AUXColumnOIDTableOIDmap fAUXColumnOIDToTableOIDMap; + boost::mutex fAUXColumnOIDToTableOIDMapLock; + typedef std::map Colinfomap; Colinfomap fColinfomap; boost::mutex fColinfomapLock; @@ -927,6 +930,7 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog // MCOL-5021 const datatypes::SystemCatalog::ColDataType AUX_COL_DATATYPE = datatypes::SystemCatalog::UTINYINT; const int32_t AUX_COL_WIDTH = 1; +// TODO MCOL-5021 compressionType is hardcoded to 2 (SNAPPY) const CalpontSystemCatalog::CompressionType AUX_COL_COMPRESSION_TYPE = CalpontSystemCatalog::COMPRESSION2; const std::string AUX_COL_DATATYPE_STRING = "unsigned-tinyint"; const uint64_t AUX_COL_MINVALUE = MIN_UTINYINT; diff --git a/primitives/primproc/columncommand.cpp b/primitives/primproc/columncommand.cpp index 80a012626..e70521d8f 100644 --- a/primitives/primproc/columncommand.cpp +++ b/primitives/primproc/columncommand.cpp @@ -849,7 +849,7 @@ void ColumnCommand::nextLBID() lbid += colType.colWidth; if (_hasAuxCol) - lbidAux += 1; + lbidAux += execplan::AUX_COL_WIDTH; } void ColumnCommand::duplicate(ColumnCommand* cc) @@ -961,7 +961,7 @@ void ColumnCommand::getLBIDList(uint32_t loopCount, vector* lbids) if (_hasAuxCol) { firstLBID = lbidAux; - lastLBID = firstLBID + (loopCount * 1) - 1; + lastLBID = firstLBID + (loopCount * execplan::AUX_COL_WIDTH) - 1; for (i = firstLBID; i <= lastLBID; i++) lbids->push_back(i); diff --git a/writeengine/server/we_dmlcommandproc.cpp b/writeengine/server/we_dmlcommandproc.cpp index 9732b1128..264a47dd1 100644 --- a/writeengine/server/we_dmlcommandproc.cpp +++ b/writeengine/server/we_dmlcommandproc.cpp @@ -4730,7 +4730,7 @@ int WE_DMLCommandProc::validateColumnHWMs(CalpontSystemCatalog::RIDList& ridList // Find out column width if (hasAuxCol && (k == segFileInfo.size() - 1)) { - colWidth = 1; + colWidth = execplan::AUX_COL_WIDTH; } else { @@ -4805,7 +4805,7 @@ int WE_DMLCommandProc::validateColumnHWMs(CalpontSystemCatalog::RIDList& ridList if (hasAuxCol && (k1 == segFileInfo.size() - 1)) { - colWidth2 = 1; + colWidth2 = execplan::AUX_COL_WIDTH; } else { @@ -4963,7 +4963,7 @@ errorCheck: if (hasAuxCol && (refCol == ridList.size() - 1)) { - colWidth1 = 1; + colWidth1 = execplan::AUX_COL_WIDTH; } else { @@ -4973,7 +4973,7 @@ errorCheck: if (hasAuxCol && (colIdx == ridList.size() - 1)) { - colWidth2 = 1; + colWidth2 = execplan::AUX_COL_WIDTH; } else { diff --git a/writeengine/shared/we_config.cpp b/writeengine/shared/we_config.cpp index c3169bd00..e3a957a87 100644 --- a/writeengine/shared/we_config.cpp +++ b/writeengine/shared/we_config.cpp @@ -188,13 +188,13 @@ void Config::checkReload() const std::string fastDeleteTemp = cf->getConfig("WriteEngine", "FastDelete"); - if (fastDeleteTemp.length() == 0 || boost::iequals(fastDeleteTemp, "false")) + if (fastDeleteTemp.length() != 0 && boost::iequals(fastDeleteTemp, "true")) { - m_FastDelete = false; + m_FastDelete = true; } else { - m_FastDelete = true; + m_FastDelete = false; } //--------------------------------------------------------------------------