summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/durable_catalog_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/storage/durable_catalog_impl.cpp')
-rw-r--r--src/mongo/db/storage/durable_catalog_impl.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/storage/durable_catalog_impl.cpp b/src/mongo/db/storage/durable_catalog_impl.cpp
index b991c213bc3..de8b719918b 100644
--- a/src/mongo/db/storage/durable_catalog_impl.cpp
+++ b/src/mongo/db/storage/durable_catalog_impl.cpp
@@ -65,6 +65,7 @@ const char kNamespaceFieldName[] = "ns";
const char kNonRepairableFeaturesFieldName[] = "nonRepairable";
const char kRepairableFeaturesFieldName[] = "repairable";
const char kInternalIdentPrefix[] = "internal-";
+const char kResumableIndexBuildIdentStem[] = "resumable-index-build-";
void appendPositionsOfBitsSet(uint64_t value, StringBuilder* sb) {
invariant(sb);
@@ -427,8 +428,17 @@ bool DurableCatalogImpl::_hasEntryCollidingWithRand() const {
}
std::string DurableCatalogImpl::newInternalIdent() {
+ return _newInternalIdent("");
+}
+
+std::string DurableCatalogImpl::newInternalResumableIndexBuildIdent() {
+ return _newInternalIdent(kResumableIndexBuildIdentStem);
+}
+
+std::string DurableCatalogImpl::_newInternalIdent(StringData identStem) {
StringBuilder buf;
buf << kInternalIdentPrefix;
+ buf << identStem;
buf << _next.fetchAndAdd(1) << '-' << _rand;
return buf.str();
}
@@ -765,6 +775,11 @@ bool DurableCatalogImpl::isInternalIdent(StringData ident) const {
return ident.find(kInternalIdentPrefix) != std::string::npos;
}
+bool DurableCatalogImpl::isResumableIndexBuildIdent(StringData ident) const {
+ invariant(isInternalIdent(ident), ident.toString());
+ return ident.find(kResumableIndexBuildIdentStem) != std::string::npos;
+}
+
bool DurableCatalogImpl::isCollectionIdent(StringData ident) const {
// Internal idents prefixed "internal-" should not be considered collections, because
// they are not eligible for orphan recovery through repair.