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

MCOL-859 DDL System catalog mutex deadlock

A race between a DDL change and a system catalog version cache update
can cause a deadlock in DDLProc. This makes the mutex recursive.
This commit is contained in:
Andrew Hutchings
2017-09-15 10:05:19 +01:00
parent d5a3cf1cf6
commit f15b2390a3
2 changed files with 4 additions and 3 deletions

View File

@ -1187,7 +1187,7 @@ const CalpontSystemCatalog::ColType CalpontSystemCatalog::colTypeDct(const OID&
}
// check map first cached column type
boost::mutex::scoped_lock lk3(fDctTokenMapLock);
boost::recursive_mutex::scoped_lock lk3(fDctTokenMapLock);
DctTokenMap::const_iterator iter = fDctTokenMap.find(dictOid);
if (iter != fDctTokenMap.end())
return colType(iter->second);
@ -5317,7 +5317,7 @@ void CalpontSystemCatalog::flushCache()
buildSysTablemap();
lk3.unlock();
boost::mutex::scoped_lock lk4(fDctTokenMapLock);
boost::recursive_mutex::scoped_lock lk4(fDctTokenMapLock);
fDctTokenMap.clear();
buildSysDctmap();
lk4.unlock();

View File

@ -869,7 +869,8 @@ private:
typedef std::map<OID, OID> DctTokenMap;
DctTokenMap fDctTokenMap;
boost::mutex fDctTokenMapLock;
// MCOL-859: this can lock when already locked in the same thread
boost::recursive_mutex fDctTokenMapLock;
typedef std::map<OID, TableName> TableNameMap;
TableNameMap fTableNameMap;