summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/collection_sharding_state.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2019-02-26 08:27:04 -0500
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2019-02-28 07:36:35 -0500
commit851dad7902d6bb8c3ed25f99f565a2e2c8c8bc47 (patch)
tree63db6c7ca09b69e442afda8dc3d86babb5ee19a7 /src/mongo/db/s/collection_sharding_state.h
parent8b4f0a7893a329b0c0370385180d6a13077a8f22 (diff)
downloadmongo-851dad7902d6bb8c3ed25f99f565a2e2c8c8bc47.tar.gz
SERVER-39495 Only return versioned filtering metadata for cases that actually need to do filtering
Diffstat (limited to 'src/mongo/db/s/collection_sharding_state.h')
-rw-r--r--src/mongo/db/s/collection_sharding_state.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/mongo/db/s/collection_sharding_state.h b/src/mongo/db/s/collection_sharding_state.h
index 1854fe51310..1f1a0c76e6f 100644
--- a/src/mongo/db/s/collection_sharding_state.h
+++ b/src/mongo/db/s/collection_sharding_state.h
@@ -75,16 +75,26 @@ public:
static void report(OperationContext* opCtx, BSONObjBuilder* builder);
/**
- * Returns the chunk filtering metadata that the current operation should be using for that
- * collection or otherwise throws if it has not been loaded yet. If the operation does not
- * require a specific shard version, returns an UNSHARDED metadata. The returned object is safe
- * to access outside of collection lock.
+ * Returns the orphan chunk filtering metadata that the current operation should be using for
+ * the collection.
*
- * If the operation context contains an 'atClusterTime' property, the returned filtering
- * metadata will be tied to a specific point in time. Otherwise it will reference the latest
- * time available.
+ * If the operation context contains an 'atClusterTime', the returned filtering metadata will be
+ * tied to a specific point in time. Otherwise, it will reference the latest time available. If
+ * the operation is not associated with a shard version (refer to
+ * OperationShardingState::isOperationVersioned for more info on that), returns an UNSHARDED
+ * metadata object.
+ *
+ * The intended users of this method are callers which need to perform orphan filtering. Use
+ * 'getCurrentMetadata' for all other cases, where just sharding-related properties of the
+ * collection are necessary (e.g., isSharded or the shard key).
+ *
+ * The returned object is safe to access even after the collection lock has been dropped.
+ */
+ ScopedCollectionMetadata getOrphansFilter(OperationContext* opCtx);
+
+ /**
+ * See the comments for 'getOrphansFilter' above for more information on this method.
*/
- ScopedCollectionMetadata getMetadataForOperation(OperationContext* opCtx);
ScopedCollectionMetadata getCurrentMetadata();
/**