summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/catalog_control.cpp
diff options
context:
space:
mode:
authorDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-06-27 12:47:00 -0400
committerDaniel Gottlieb <daniel.gottlieb@mongodb.com>2018-06-27 12:47:00 -0400
commit7bac7301b387e843e5672ad50d3ffcfcd807cb03 (patch)
tree594dba7d8898c73ab488137e20112cc99a2d5dda /src/mongo/db/catalog/catalog_control.cpp
parentdc849ad01396b513e61ae389b3bce4b28f3404be (diff)
downloadmongo-7bac7301b387e843e5672ad50d3ffcfcd807cb03.tar.gz
Revert "SERVER-35317: Preserve minVisible values when refreshing the catalog."
This reverts commit dc849ad01396b513e61ae389b3bce4b28f3404be.
Diffstat (limited to 'src/mongo/db/catalog/catalog_control.cpp')
-rw-r--r--src/mongo/db/catalog/catalog_control.cpp31
1 files changed, 2 insertions, 29 deletions
diff --git a/src/mongo/db/catalog/catalog_control.cpp b/src/mongo/db/catalog/catalog_control.cpp
index e0421fc338f..7edb945faa5 100644
--- a/src/mongo/db/catalog/catalog_control.cpp
+++ b/src/mongo/db/catalog/catalog_control.cpp
@@ -43,30 +43,9 @@
namespace mongo {
namespace catalog {
-MinVisibleTimestampMap closeCatalog(OperationContext* opCtx) {
+void closeCatalog(OperationContext* opCtx) {
invariant(opCtx->lockState()->isW());
- MinVisibleTimestampMap minVisibleTimestampMap;
- std::vector<std::string> allDbs;
- opCtx->getServiceContext()->getStorageEngine()->listDatabases(&allDbs);
-
- const auto& databaseHolder = DatabaseHolder::getDatabaseHolder();
- for (auto&& dbName : allDbs) {
- const auto db = databaseHolder.get(opCtx, dbName);
- for (Collection* coll : *db) {
- OptionalCollectionUUID uuid = coll->uuid();
- boost::optional<Timestamp> minVisible = coll->getMinimumVisibleSnapshot();
-
- // If there's a minimum visible, invariant there's also a UUID.
- invariant(!minVisible || uuid);
- if (uuid && minVisible) {
- LOG(1) << "closeCatalog: preserving min visible timestamp. Collection: "
- << coll->ns() << " UUID: " << uuid << " TS: " << minVisible;
- minVisibleTimestampMap[*uuid] = *minVisible;
- }
- }
- }
-
// Closing UUID Catalog: only lookupNSSByUUID will fall back to using pre-closing state to
// allow authorization for currently unknown UUIDs. This is needed because authorization needs
// to work before acquiring locks, and might otherwise spuriously regard a UUID as unknown
@@ -82,11 +61,9 @@ MinVisibleTimestampMap closeCatalog(OperationContext* opCtx) {
// Close the storage engine's catalog.
log() << "closeCatalog: closing storage engine catalog";
opCtx->getServiceContext()->getStorageEngine()->closeCatalog(opCtx);
-
- return minVisibleTimestampMap;
}
-void openCatalog(OperationContext* opCtx, const MinVisibleTimestampMap& minVisibleTimestampMap) {
+void openCatalog(OperationContext* opCtx) {
invariant(opCtx->lockState()->isW());
// Load the catalog in the storage engine.
@@ -188,10 +165,6 @@ void openCatalog(OperationContext* opCtx, const MinVisibleTimestampMap& minVisib
<< collName;
uuidCatalog.registerUUIDCatalogEntry(*uuid, collection);
- if (minVisibleTimestampMap.count(*uuid) > 0) {
- collection->setMinimumVisibleSnapshot(minVisibleTimestampMap.find(*uuid)->second);
- }
-
// If this is the oplog collection, re-establish the replication system's cached pointer
// to the oplog.
if (collNss.isOplog()) {