0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-38597 Add drop-pending ident counter to serverStatus

This commit is contained in:
Xiangyu Yao 2019-01-10 12:14:39 -05:00
parent c338365277
commit 3b028cfc6f
5 changed files with 17 additions and 0 deletions

View File

@ -74,6 +74,9 @@
mydb.getName() + ' after dropping collection ' + coll.getFullName() +
'. Before: ' + tojson(collectionsBeforeDrop) + '. After: ' +
tojson(collectionsAfterDrop));
assert.gt(mydb.serverStatus().storageEngine.dropPendingIdents,
0,
'There is no drop pending ident in the storage engine.');
}
const renameTargetColl = node.getCollection(renameTargetCollName);

View File

@ -91,6 +91,9 @@ public:
std::string getFilesystemPathForDb(const std::string& dbName) const final {
return "";
}
std::set<std::string> getDropPendingIdents() const final {
return {};
}
};
/**

View File

@ -355,6 +355,10 @@ public:
return _timestampMonitor.get();
}
std::set<std::string> getDropPendingIdents() const {
return _dropPendingIdentReaper.getAllIdents();
}
private:
using CollIter = std::list<std::string>::iterator;

View File

@ -354,6 +354,11 @@ public:
*/
virtual bool supportsPendingDrops() const = 0;
/**
* Returns a set of drop pending idents inside the storage engine.
*/
virtual std::set<std::string> getDropPendingIdents() const = 0;
/**
* Clears list of drop-pending idents in the storage engine.
* Used primarily by rollback after recovering to a stable timestamp.

View File

@ -60,6 +60,8 @@ public:
<< engine->supportsReadConcernMajority()
<< "supportsPendingDrops"
<< engine->supportsPendingDrops()
<< "dropPendingIdents"
<< static_cast<long long>(engine->getDropPendingIdents().size())
<< "supportsSnapshotReadConcern"
<< engine->supportsReadConcernSnapshot()
<< "readOnly"