summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2018-05-25 22:07:24 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2018-05-25 22:07:24 -0400
commit25f72cf5f1d0d894680ef855f646e27f234ce6a3 (patch)
tree6d6db543f58eaf808332c50d3491a1e24ddffdf9 /src/mongo/db/commands
parentf0e5229b631668c9bde511e607bf52fd871e582d (diff)
downloadmongo-25f72cf5f1d0d894680ef855f646e27f234ce6a3.tar.gz
SERVER-34779 Add hook for checking dbhash while a test is running.
Enables the CheckReplDBHashInBackground hook in the replica_sets_jscore_passthrough.yml test suite. Also fixes the WTPreserveSnapshotHistoryIndefinitely failpoint to ignore attempts from _decreaseTargetSnapshotWindowSize() to move the oldest timestamp forward.
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r--src/mongo/db/commands/dbhash.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp
index 29a7e1fb129..42375adb09f 100644
--- a/src/mongo/db/commands/dbhash.cpp
+++ b/src/mongo/db/commands/dbhash.cpp
@@ -142,6 +142,8 @@ public:
"system.version",
"system.views"};
+ BSONArrayBuilder cappedCollections;
+ BSONObjBuilder collectionsByUUID;
BSONObjBuilder bb(result.subobjStart("collections"));
for (const auto& collectionName : colls) {
@@ -159,6 +161,11 @@ public:
if (collNss.isSystem() && !isReplicatedSystemColl)
continue;
+ if (collNss.coll().startsWith("tmp.mr.")) {
+ // We skip any incremental map reduce collections as they also aren't replicated.
+ continue;
+ }
+
if (desiredCollections.size() > 0 &&
desiredCollections.count(collNss.coll().toString()) == 0)
continue;
@@ -167,6 +174,16 @@ public:
if (collNss.isDropPendingNamespace())
continue;
+ if (Collection* collection = db->getCollection(opCtx, collectionName)) {
+ if (collection->isCapped()) {
+ cappedCollections.append(collNss.coll());
+ }
+
+ if (OptionalCollectionUUID uuid = collection->uuid()) {
+ uuid->appendToBuilder(&collectionsByUUID, collNss.coll());
+ }
+ }
+
// Compute the hash for this collection.
std::string hash = _hashCollection(opCtx, db, collNss.toString());
@@ -175,6 +192,9 @@ public:
}
bb.done();
+ result.append("capped", BSONArray(cappedCollections.done()));
+ result.append("uuids", collectionsByUUID.done());
+
md5digest d;
md5_finish(&globalState, d);
std::string hash = digestToString(d);