summaryrefslogtreecommitdiff
path: root/src/mongo/db/keys_collection_manager.cpp
diff options
context:
space:
mode:
authorMisha Tyulenev <misha@mongodb.com>2017-06-13 15:25:01 -0400
committerMisha Tyulenev <misha@mongodb.com>2017-06-13 17:22:02 -0400
commit04710415238d2e2aae526a9d63f93306de60fce3 (patch)
tree0d2f8b90c02c152648503c0a6a5a3d8e1d1507f2 /src/mongo/db/keys_collection_manager.cpp
parent08732c2bdaa2bfd475241dc4bd994891d27c012a (diff)
downloadmongo-04710415238d2e2aae526a9d63f93306de60fce3.tar.gz
SERVER-28972 match return key by keyId in KeysCollectionManager::getKeyForValidation
Diffstat (limited to 'src/mongo/db/keys_collection_manager.cpp')
-rw-r--r--src/mongo/db/keys_collection_manager.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/mongo/db/keys_collection_manager.cpp b/src/mongo/db/keys_collection_manager.cpp
index 5dea71eb123..425a69e9f5a 100644
--- a/src/mongo/db/keys_collection_manager.cpp
+++ b/src/mongo/db/keys_collection_manager.cpp
@@ -102,24 +102,13 @@ StatusWith<KeysCollectionDocument> KeysCollectionManager::getKeyForSigning(
StatusWith<KeysCollectionDocument> KeysCollectionManager::_getKeyWithKeyIdCheck(
long long keyId, const LogicalTime& forThisTime) {
- auto keyStatus = _getKey(forThisTime);
+ auto keyStatus = _keysCache.getKeyById(keyId, forThisTime);
if (!keyStatus.isOK()) {
return keyStatus;
}
- auto key = keyStatus.getValue();
-
- if (keyId == key.getKeyId()) {
- return key;
- }
-
- // Key not expired but keyId does not match!
- return {ErrorCodes::KeyNotFound,
- str::stream() << "No keys found for " << _purpose << " that is valid for time: "
- << forThisTime.toString()
- << " with id: "
- << keyId};
+ return keyStatus.getValue();
}
StatusWith<KeysCollectionDocument> KeysCollectionManager::_getKey(const LogicalTime& forThisTime) {