summaryrefslogtreecommitdiff
path: root/src/mongo/db/keys_collection_client_direct.h
diff options
context:
space:
mode:
authorCheahuychou Mao <mao.cheahuychou@gmail.com>2021-01-11 05:14:06 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-01-15 22:47:49 +0000
commitae738118f9f8f6ef93bc4482489cab9955a2bcb1 (patch)
tree3b6b21db4f7766de948666b6b5b188890f58dd35 /src/mongo/db/keys_collection_client_direct.h
parentf99876a23cd41e89331a2fb2a3c3d799e2b514a7 (diff)
downloadmongo-ae738118f9f8f6ef93bc4482489cab9955a2bcb1.tar.gz
SERVER-53403 Support validating cluster times with keys from external_validation_keys
Diffstat (limited to 'src/mongo/db/keys_collection_client_direct.h')
-rw-r--r--src/mongo/db/keys_collection_client_direct.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/src/mongo/db/keys_collection_client_direct.h b/src/mongo/db/keys_collection_client_direct.h
index 3b101d99167..9cd71aad750 100644
--- a/src/mongo/db/keys_collection_client_direct.h
+++ b/src/mongo/db/keys_collection_client_direct.h
@@ -45,13 +45,24 @@ class KeysCollectionClientDirect : public KeysCollectionClient {
public:
KeysCollectionClientDirect();
/**
- * Returns keys for the given purpose and with an expiresAt value greater than newerThanThis,
- * using readConcern level majority if possible.
+ * Returns keys in admin.system.keys that match the given purpose and have an expiresAt value
+ * greater than newerThanThis. Uses readConcern level majority if possible.
*/
- StatusWith<std::vector<KeysCollectionDocument>> getNewKeys(OperationContext* opCtx,
- StringData purpose,
- const LogicalTime& newerThanThis,
- bool useMajority) override;
+ StatusWith<std::vector<KeysCollectionDocument>> getNewInternalKeys(
+ OperationContext* opCtx,
+ StringData purpose,
+ const LogicalTime& newerThanThis,
+ bool useMajority) override;
+
+ /**
+ * Returns keys in admin.system.external_validation_keys that match the given purpose and have
+ * an expiresAt value greater than newerThanThis. Uses readConcern level majority if possible.
+ */
+ StatusWith<std::vector<ExternalKeysCollectionDocument>> getNewExternalKeys(
+ OperationContext* opCtx,
+ StringData purpose,
+ const LogicalTime& newerThanThis,
+ bool useMajority) override;
/**
* Directly inserts a key document to the storage
@@ -67,6 +78,17 @@ public:
}
private:
+ /**
+ * Returns keys in the given collection that match the given purpose and have an expiresAt value
+ * greater than newerThanThis, using readConcern level majority if possible.
+ */
+ template <typename KeyDocumentType>
+ StatusWith<std::vector<KeyDocumentType>> _getNewKeys(OperationContext* opCtx,
+ const NamespaceString& nss,
+ StringData purpose,
+ const LogicalTime& newerThanThis,
+ bool useMajority);
+
StatusWith<Shard::QueryResponse> _query(OperationContext* opCtx,
const ReadPreferenceSetting& readPref,
const repl::ReadConcernLevel& readConcernLevel,