You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
feat(MCOL-6082): Multiple readers of dbroots using OamCache logic
This patch introduces centralized logic of selecting what dbroot is accessible in PrimProc on what node. The logic is in OamCache for time being and can be moved later.
This commit is contained in:
@ -4144,13 +4144,12 @@ uint64_t DBRM::getTableLock(const vector<uint32_t>& pmList, uint32_t tableOID, s
|
||||
uint32_t tmp32;
|
||||
vector<uint32_t> dbRootsList;
|
||||
OamCache* oamcache = OamCache::makeOamCache();
|
||||
OamCache::PMDbrootsMap_t pmDbroots = oamcache->getPMToDbrootsMap();
|
||||
int moduleId = 0;
|
||||
|
||||
for (uint32_t i = 0; i < pmList.size(); i++)
|
||||
{
|
||||
moduleId = pmList[i];
|
||||
vector<int> dbroots = (*pmDbroots)[moduleId];
|
||||
vector<int> dbroots = oamcache->getPMDBRoots(moduleId);
|
||||
|
||||
for (uint32_t j = 0; j < dbroots.size(); j++)
|
||||
dbRootsList.push_back((uint32_t)dbroots[j]);
|
||||
|
@ -1826,7 +1826,7 @@ void ExtentMap::save(const string& filename)
|
||||
|
||||
if (!out)
|
||||
{
|
||||
log_errno("ExtentMap::save(): can't open file " + filename);
|
||||
log_errno("ExtentMap::save(): open");
|
||||
releaseFreeList(READ);
|
||||
releaseEMIndex(READ);
|
||||
releaseEMEntryTable(READ);
|
||||
@ -4541,7 +4541,7 @@ void ExtentMap::getDbRootHWMInfo(int OID, uint16_t pmNumber, EmDbRootHWMInfo_v&
|
||||
"There are no DBRoots for OID "
|
||||
<< OID << " and PM " << pmNumber << endl;
|
||||
log(oss.str(), logging::LOG_TYPE_CRITICAL);
|
||||
throw invalid_argument(oss.str());
|
||||
// previously it was logic error with invalid_argument(oss.str()) exception.
|
||||
}
|
||||
|
||||
grabEMEntryTable(READ);
|
||||
@ -6178,10 +6178,8 @@ unsigned ExtentMap::getDbRootCount()
|
||||
void ExtentMap::getPmDbRoots(int pm, vector<int>& dbRootVec)
|
||||
{
|
||||
oam::OamCache* oamcache = oam::OamCache::makeOamCache();
|
||||
oam::OamCache::PMDbrootsMap_t pmDbroots = oamcache->getPMToDbrootsMap();
|
||||
|
||||
dbRootVec.clear();
|
||||
dbRootVec = (*pmDbroots)[pm];
|
||||
dbRootVec = oamcache->getPMDBRoots(pm);
|
||||
}
|
||||
|
||||
DBRootVec ExtentMap::getAllDbRoots()
|
||||
@ -6189,13 +6187,11 @@ DBRootVec ExtentMap::getAllDbRoots()
|
||||
DBRootVec dbRootResultVec;
|
||||
oam::OamCache* oamcache = oam::OamCache::makeOamCache();
|
||||
// NB The routine uses int for dbroot id that contradicts with the type used here, namely uint16_t
|
||||
oam::OamCache::PMDbrootsMap_t pmDbroots = oamcache->getPMToDbrootsMap();
|
||||
auto& pmDbrootsRef = *pmDbroots;
|
||||
auto pmDbroots = oamcache->getAllDBRoots();
|
||||
|
||||
for (auto& pmDBRootPair : pmDbrootsRef)
|
||||
for (auto& DBRoot : pmDbroots)
|
||||
{
|
||||
for (auto dbRootId : pmDBRootPair.second)
|
||||
dbRootResultVec.push_back(dbRootId);
|
||||
dbRootResultVec.push_back(DBRoot);
|
||||
}
|
||||
return dbRootResultVec;
|
||||
}
|
||||
|
Reference in New Issue
Block a user