diff --git a/versioning/BRM/extentmap.cpp b/versioning/BRM/extentmap.cpp index 0f8d32a88..fab238286 100644 --- a/versioning/BRM/extentmap.cpp +++ b/versioning/BRM/extentmap.cpp @@ -527,12 +527,19 @@ ExtentMapIndexFindResult ExtentMapIndexImpl::search3dLayer(PartitionIndexContain void ExtentMapIndexImpl::deleteDbRoot(const DBRootT dbroot) { auto& extMapIndex = *get(); + if (dbroot >= extMapIndex.size()) + return; // nothing to delete extMapIndex[dbroot].clear(); } void ExtentMapIndexImpl::deleteOID(const DBRootT dbroot, const OID_t oid) { auto& extMapIndex = *get(); + // nothing to delete + if (dbroot >= extMapIndex.size()) + return; + if (extMapIndex[dbroot].empty()) + return; auto oidsIter = extMapIndex[dbroot].find(oid); // Nothing to delete. Might be a sign of a problem. if (oidsIter == extMapIndex[dbroot].end()) @@ -544,6 +551,10 @@ void ExtentMapIndexImpl::deleteEMEntry(const EMEntry& emEntry, const ExtentMapId { // find partition auto& extMapIndex = *get(); + if (emEntry.dbRoot >= extMapIndex.size()) + return; + if (extMapIndex[emEntry.dbRoot].empty()) + return; auto oidsIter = extMapIndex[emEntry.dbRoot].find(emEntry.fileID); if (oidsIter == extMapIndex[emEntry.dbRoot].end()) return; @@ -1646,7 +1657,6 @@ void ExtentMap::loadVersion4or5(T* in, bool upgradeV4ToV5) } growEMShmseg(nrows); - growEMIndexShmseg(ExtentMapIndexImpl::estimateEMIndexSize(emNumElements)); } size_t progress = 0, writeSize = emNumElements * sizeof(EMEntry);