summaryrefslogtreecommitdiff
path: root/src/mongo/db/storage/bson_collection_catalog_entry.cpp
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-02-21 22:13:20 -0500
committerDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-02-21 22:13:23 -0500
commit80b1a54a112b5853d0903ae424ffc5e3bb289077 (patch)
tree3b2cad4010d1deb12a7f91686f5437c48822c896 /src/mongo/db/storage/bson_collection_catalog_entry.cpp
parent3157be3048cdeb676579ed0d860d8416cb8c4667 (diff)
downloadmongo-80b1a54a112b5853d0903ae424ffc5e3bb289077.tar.gz
SERVER-33359: Allow RTT storage engines to manage indexes on rollback.
Diffstat (limited to 'src/mongo/db/storage/bson_collection_catalog_entry.cpp')
-rw-r--r--src/mongo/db/storage/bson_collection_catalog_entry.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/storage/bson_collection_catalog_entry.cpp b/src/mongo/db/storage/bson_collection_catalog_entry.cpp
index 57440d12e4d..9703e5f1a89 100644
--- a/src/mongo/db/storage/bson_collection_catalog_entry.cpp
+++ b/src/mongo/db/storage/bson_collection_catalog_entry.cpp
@@ -278,6 +278,7 @@ BSONObj BSONCollectionCatalogEntry::MetaData::toBSON() const {
sub.append("head", static_cast<long long>(indexes[i].head.repr()));
sub.append("prefix", indexes[i].prefix.toBSONValue());
+ sub.append("backgroundSecondary", indexes[i].isBackgroundSecondaryBuild);
sub.doneFast();
}
arr.doneFast();
@@ -314,6 +315,9 @@ void BSONCollectionCatalogEntry::MetaData::parse(const BSONObj& obj) {
}
imd.prefix = KVPrefix::fromBSONElement(idx["prefix"]);
+ auto bgSecondary = BSONElement(idx["backgroundSecondary"]);
+ // Opt-in to rebuilding behavior for old-format index catalog objects.
+ imd.isBackgroundSecondaryBuild = bgSecondary.eoo() || bgSecondary.trueValue();
indexes.push_back(imd);
}
}