diff options
Diffstat (limited to 'src/mongo/db/pipeline/process_interface_shardsvr.h')
-rw-r--r-- | src/mongo/db/pipeline/process_interface_shardsvr.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/process_interface_shardsvr.h b/src/mongo/db/pipeline/process_interface_shardsvr.h index ddafac24cdb..fba537a2e1a 100644 --- a/src/mongo/db/pipeline/process_interface_shardsvr.h +++ b/src/mongo/db/pipeline/process_interface_shardsvr.h @@ -43,8 +43,19 @@ class MongoInterfaceShardServer final : public MongoInterfaceStandalone { public: using MongoInterfaceStandalone::MongoInterfaceStandalone; - std::pair<std::vector<FieldPath>, bool> collectDocumentKeyFields( - OperationContext* opCtx, NamespaceStringOrUUID nssOrUUID) const final; + std::pair<std::vector<FieldPath>, bool> collectDocumentKeyFieldsForHostedCollection( + OperationContext* opCtx, const NamespaceString&, UUID) const final; + + std::vector<FieldPath> collectDocumentKeyFieldsActingAsRouter( + OperationContext*, const NamespaceString&) const final { + // We don't expect anyone to use this method on the shard itself (yet). This is currently + // only used for $out. For $out in a sharded cluster, the mongos is responsible for + // collecting the document key fields before serializing them and sending them to the + // shards. This is logically a MONGO_UNREACHABLE, but a malicious user could construct a + // request to send directly to the shards which does not include the uniqueKey, so we must + // be prepared to gracefully error. + uasserted(50997, "Unexpected attempt to consult catalog cache on a shard server"); + } /** * Inserts the documents 'objs' into the namespace 'ns' using the ClusterWriter for locking, |