diff options
author | Misha Tyulenev <misha@mongodb.com> | 2017-06-13 15:25:01 -0400 |
---|---|---|
committer | Misha Tyulenev <misha@mongodb.com> | 2017-06-13 17:22:02 -0400 |
commit | 04710415238d2e2aae526a9d63f93306de60fce3 (patch) | |
tree | 0d2f8b90c02c152648503c0a6a5a3d8e1d1507f2 /src/mongo/db/keys_collection_manager.cpp | |
parent | 08732c2bdaa2bfd475241dc4bd994891d27c012a (diff) | |
download | mongo-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.cpp | 15 |
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) { |