diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 782a228aea1..f8021bbdb16 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1836,7 +1836,7 @@ WORKSPACE.bazel @10gen/devprod-build @svc-auto-approve-bot /src/mongo/db/**/dbmessage* @10gen/server-networking-and-observability @svc-auto-approve-bot /src/mongo/db/**/default_baton* @10gen/server-programmability @svc-auto-approve-bot /src/mongo/db/**/diagnostic_printers_test.cpp @10gen/query-integration-observability @svc-auto-approve-bot -/src/mongo/db/**/keypattern.h @10gen/query-execution @10gen/query-optimization @svc-auto-approve-bot +/src/mongo/db/**/keypattern* @10gen/query-execution @10gen/query-optimization @svc-auto-approve-bot /src/mongo/db/**/error_labels* @10gen/server-programmability @svc-auto-approve-bot /src/mongo/db/**/field_parser* @10gen/server-programmability @svc-auto-approve-bot /src/mongo/db/**/generic_argument_util.* @10gen/server-programmability @svc-auto-approve-bot @@ -2884,6 +2884,7 @@ WORKSPACE.bazel @10gen/devprod-build @svc-auto-approve-bot /src/mongo/db/stats/**/change_stream* @10gen/query-execution-change-streams @svc-auto-approve-bot /src/mongo/db/stats/**/system_buckets_metrics* @10gen/server-catalog-and-routing @svc-auto-approve-bot /src/mongo/db/stats/**/timer_stats* @10gen/server-programmability @svc-auto-approve-bot +/src/mongo/db/stats/**/counter_ops.h @10gen/server-programmability @svc-auto-approve-bot # The following patterns are parsed from ./src/mongo/db/storage/OWNERS.yml /src/mongo/db/storage/**/* @10gen/server-storage-engine-integration @svc-auto-approve-bot diff --git a/modules_poc/modules.yaml b/modules_poc/modules.yaml index 2af77b15e4e..d0d7c5b5e3a 100644 --- a/modules_poc/modules.yaml +++ b/modules_poc/modules.yaml @@ -60,6 +60,7 @@ core: - src/mongo/executor/task_executor[._]* - src/mongo/executor/thread_pool[._]* - src/mongo/db/exec/scoped_timer* + - src/mongo/db/stats/counter_ops.h core.bson: files: @@ -273,6 +274,7 @@ catalog_and_routing: - src/mongo/db/rs_local_client* - src/mongo/db/database_name[._]* - src/mongo/db/namespace_string[._]* + - src/mongo/db/stats/system_buckets_metrics* - src/mongo/util/namespace_string[._]* - src/mongo/util/database_name[._]* @@ -375,6 +377,7 @@ transactions: - src/mongo/db/commands/*session* - src/mongo/dbtests/logical_sessions_tests.cpp - src/mongo/s/client_transport_observer_mongos* + - src/mongo/db/stats/read_preference_metrics.idl fcv: meta: @@ -1074,6 +1077,7 @@ replication.server_rw_concerns: - src/mongo/db/repl/*speculative_majority_read_info* - src/mongo/db/stats/server_write_concern* - src/mongo/db/stats/server_read_concern* + - src/mongo/db/stats/read_concern_stats.idl - src/mongo/db/write_concern* replication.rs_aware_service: diff --git a/src/mongo/db/OWNERS.yml b/src/mongo/db/OWNERS.yml index b294d405caa..92e7db8b6df 100644 --- a/src/mongo/db/OWNERS.yml +++ b/src/mongo/db/OWNERS.yml @@ -52,7 +52,7 @@ filters: - "diagnostic_printers_test.cpp": approvers: - 10gen/query-integration-observability - - "keypattern.h": + - "keypattern*": approvers: - 10gen/query-optimization - 10gen/query-execution diff --git a/src/mongo/db/exec/document_value/document.h b/src/mongo/db/exec/document_value/document.h index 21ba0c41078..8e44972ffd5 100644 --- a/src/mongo/db/exec/document_value/document.h +++ b/src/mongo/db/exec/document_value/document.h @@ -44,6 +44,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/bufreader.h" #include "mongo/util/intrusive_counter.h" +#include "mongo/util/modules.h" #include "mongo/util/string_map.h" #include @@ -61,7 +62,7 @@ #include #include -namespace mongo { +namespace MONGO_MOD_PUBLIC mongo { class BSONObj; class FieldIterator; @@ -995,4 +996,4 @@ inline MutableValue MutableValue::getField(Position pos) { inline MutableValue MutableValue::getField(StringData key) { return MutableDocument(*this).getField(key); } -} // namespace mongo +} // namespace MONGO_MOD_PUBLIC mongo diff --git a/src/mongo/db/exec/document_value/document_comparator.h b/src/mongo/db/exec/document_value/document_comparator.h index 728086ac5a5..4578e271f1a 100644 --- a/src/mongo/db/exec/document_value/document_comparator.h +++ b/src/mongo/db/exec/document_value/document_comparator.h @@ -34,13 +34,14 @@ #include "mongo/stdx/unordered_map.h" #include "mongo/stdx/unordered_set.h" #include "mongo/util/intrusive_counter.h" +#include "mongo/util/modules.h" #include #include #include -namespace mongo { +namespace MONGO_MOD_PUBLIC mongo { class DocumentComparator { public: @@ -203,4 +204,4 @@ template using DocumentUnorderedMap = stdx::unordered_map; -} // namespace mongo +} // namespace MONGO_MOD_PUBLIC mongo diff --git a/src/mongo/db/exec/document_value/document_internal.h b/src/mongo/db/exec/document_value/document_internal.h index 30d2502696d..60c7621c34b 100644 --- a/src/mongo/db/exec/document_value/document_internal.h +++ b/src/mongo/db/exec/document_value/document_internal.h @@ -33,6 +33,7 @@ #include "mongo/db/exec/document_value/document_metadata_fields.h" #include "mongo/db/exec/document_value/value.h" #include "mongo/util/intrusive_counter.h" +#include "mongo/util/modules.h" #include diff --git a/src/mongo/db/exec/document_value/document_metadata_fields.h b/src/mongo/db/exec/document_value/document_metadata_fields.h index dc0b7d73fc8..160b53c5afd 100644 --- a/src/mongo/db/exec/document_value/document_metadata_fields.h +++ b/src/mongo/db/exec/document_value/document_metadata_fields.h @@ -37,6 +37,7 @@ #include "mongo/db/record_id.h" #include "mongo/util/assert_util.h" #include "mongo/util/bufreader.h" +#include "mongo/util/modules.h" #include "mongo/util/time_support.h" #include @@ -45,7 +46,7 @@ #include #include -namespace mongo { +namespace MONGO_MOD_PUBLIC mongo { /** * This class represents the metadata that the query execution engine can associate with a * particular intermediate result (either index key or document) passing between execution stages. @@ -559,4 +560,4 @@ using QueryMetadataBitSet = std::bitset #include -namespace mongo { +namespace MONGO_MOD_PUBLIC mongo { class BSONElement; /** A variant type that can hold any type of data representable in BSON @@ -503,7 +504,7 @@ public: return values; } }; -} // namespace mongo +} // namespace MONGO_MOD_PUBLIC mongo /* ======================= INLINED IMPLEMENTATIONS ========================== */ diff --git a/src/mongo/db/exec/document_value/value_comparator.h b/src/mongo/db/exec/document_value/value_comparator.h index 2c70c28605d..9d22599e453 100644 --- a/src/mongo/db/exec/document_value/value_comparator.h +++ b/src/mongo/db/exec/document_value/value_comparator.h @@ -33,6 +33,7 @@ #include "mongo/db/exec/document_value/value.h" #include "mongo/stdx/unordered_map.h" #include "mongo/stdx/unordered_set.h" +#include "mongo/util/modules.h" #include #include @@ -41,7 +42,7 @@ #include #include -namespace mongo { +namespace MONGO_MOD_PUBLIC mongo { class ValueComparator { public: @@ -241,4 +242,4 @@ template using ValueFlatUnorderedMap = absl::flat_hash_map; -} // namespace mongo +} // namespace MONGO_MOD_PUBLIC mongo diff --git a/src/mongo/db/exec/document_value/value_internal.h b/src/mongo/db/exec/document_value/value_internal.h index 9c0647813f0..915e7c4c761 100644 --- a/src/mongo/db/exec/document_value/value_internal.h +++ b/src/mongo/db/exec/document_value/value_internal.h @@ -41,6 +41,7 @@ #include "mongo/util/assert_util.h" #include "mongo/util/debug_util.h" #include "mongo/util/intrusive_counter.h" +#include "mongo/util/modules.h" #include #include diff --git a/src/mongo/db/exec/matcher/matcher.h b/src/mongo/db/exec/matcher/matcher.h index 1eb9e5dee52..ca4cf459c8a 100644 --- a/src/mongo/db/exec/matcher/matcher.h +++ b/src/mongo/db/exec/matcher/matcher.h @@ -53,8 +53,10 @@ #include "mongo/db/matcher/schema/expression_internal_schema_object_match.h" #include "mongo/db/matcher/schema/expression_internal_schema_root_doc_eq.h" #include "mongo/db/matcher/schema/expression_internal_schema_unique_items.h" +#include "mongo/util/modules.h" -namespace mongo { +// TODO SERVER-113198: Remove external dependencies on this header. +namespace MONGO_MOD_NEEDS_REPLACEMENT mongo { namespace exec::matcher { @@ -500,4 +502,4 @@ BSONElement findFirstDuplicateValue(const InternalSchemaUniqueItemsMatchExpressi bool matchesBSONObj(const InternalSchemaAllowedPropertiesMatchExpression* expr, const BSONObj& obj); } // namespace exec::matcher -} // namespace mongo +} // namespace MONGO_MOD_NEEDS_REPLACEMENT mongo diff --git a/src/mongo/db/exec/mutable_bson/api.h b/src/mongo/db/exec/mutable_bson/api.h index 0c27b2d17c8..d0bb2d63fde 100644 --- a/src/mongo/db/exec/mutable_bson/api.h +++ b/src/mongo/db/exec/mutable_bson/api.h @@ -30,6 +30,7 @@ #pragma once #include "mongo/platform/visibility.h" +#include "mongo/util/modules.h" #ifdef MONGO_API_mutable_bson // Compiling mutable_bson API #define MONGO_MUTABLE_BSON_API MONGO_API_EXPORT diff --git a/src/mongo/db/exec/mutable_bson/const_element-inl.h b/src/mongo/db/exec/mutable_bson/const_element-inl.h deleted file mode 100644 index 5e20d47e7f2..00000000000 --- a/src/mongo/db/exec/mutable_bson/const_element-inl.h +++ /dev/null @@ -1,249 +0,0 @@ -/** - * Copyright (C) 2018-present MongoDB, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * . - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the Server Side Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. - */ - -#pragma once - -namespace mongo { -namespace mutablebson { - -inline ConstElement::ConstElement(const Element& basis) : _basis(basis) {} - -inline ConstElement ConstElement::leftChild() const { - return _basis.leftChild(); -} - -inline ConstElement ConstElement::rightChild() const { - return _basis.rightChild(); -} - -inline bool ConstElement::hasChildren() const { - return _basis.hasChildren(); -} - -inline ConstElement ConstElement::leftSibling(size_t distance) const { - return _basis.leftSibling(distance); -} - -inline ConstElement ConstElement::rightSibling(size_t distance) const { - return _basis.rightSibling(distance); -} - -inline ConstElement ConstElement::parent() const { - return _basis.parent(); -} - -inline ConstElement ConstElement::findNthChild(size_t n) const { - return _basis.findNthChild(n); -} - -inline ConstElement ConstElement::operator[](size_t n) const { - return _basis[n]; -} - -inline ConstElement ConstElement::findFirstChildNamed(StringData name) const { - return _basis.findFirstChildNamed(name); -} - -inline ConstElement ConstElement::operator[](StringData name) const { - return _basis[name]; -} - -inline ConstElement ConstElement::findElementNamed(StringData name) const { - return _basis.findElementNamed(name); -} - -inline size_t ConstElement::countSiblingsLeft() const { - return _basis.countSiblingsLeft(); -} - -inline size_t ConstElement::countSiblingsRight() const { - return _basis.countSiblingsRight(); -} - -inline size_t ConstElement::countChildren() const { - return _basis.countChildren(); -} - -inline bool ConstElement::hasValue() const { - return _basis.hasValue(); -} - -inline const BSONElement ConstElement::getValue() const { - return _basis.getValue(); -} - -inline double ConstElement::getValueDouble() const { - return _basis.getValueDouble(); -} - -inline StringData ConstElement::getValueString() const { - return _basis.getValueString(); -} - -inline BSONObj ConstElement::getValueObject() const { - return _basis.getValueObject(); -} - -inline BSONArray ConstElement::getValueArray() const { - return _basis.getValueArray(); -} - -inline bool ConstElement::isValueUndefined() const { - return _basis.isValueUndefined(); -} - -inline OID ConstElement::getValueOID() const { - return _basis.getValueOID(); -} - -inline bool ConstElement::getValueBool() const { - return _basis.getValueBool(); -} - -inline Date_t ConstElement::getValueDate() const { - return _basis.getValueDate(); -} - -inline bool ConstElement::isValueNull() const { - return _basis.isValueNull(); -} - -inline StringData ConstElement::getValueSymbol() const { - return _basis.getValueSymbol(); -} - -inline int32_t ConstElement::getValueInt() const { - return _basis.getValueInt(); -} - -inline Timestamp ConstElement::getValueTimestamp() const { - return _basis.getValueTimestamp(); -} - -inline int64_t ConstElement::getValueLong() const { - return _basis.getValueLong(); -} - -inline Decimal128 ConstElement::getValueDecimal() const { - return _basis.getValueDecimal(); -} - -inline bool ConstElement::isValueMinKey() const { - return _basis.isValueMinKey(); -} - -inline bool ConstElement::isValueMaxKey() const { - return _basis.isValueMaxKey(); -} - -inline SafeNum ConstElement::getValueSafeNum() const { - return _basis.getValueSafeNum(); -} - -inline int ConstElement::compareWithElement(const ConstElement& other, - const StringDataComparator* comparator, - bool considerFieldName) const { - return _basis.compareWithElement(other, comparator, considerFieldName); -} - -inline int ConstElement::compareWithBSONElement(const BSONElement& other, - const StringDataComparator* comparator, - bool considerFieldName) const { - return _basis.compareWithBSONElement(other, comparator, considerFieldName); -} - -inline int ConstElement::compareWithBSONObj(const BSONObj& other, - const StringDataComparator* comparator, - bool considerFieldName) const { - return _basis.compareWithBSONObj(other, comparator, considerFieldName); -} - -inline void ConstElement::writeTo(BSONObjBuilder* builder) const { - return _basis.writeTo(builder); -} - -inline void ConstElement::writeArrayTo(BSONArrayBuilder* builder) const { - return _basis.writeArrayTo(builder); -} - -inline bool ConstElement::ok() const { - return _basis.ok(); -} - -inline const Document& ConstElement::getDocument() const { - return _basis.getDocument(); -} - -inline BSONType ConstElement::getType() const { - return _basis.getType(); -} - -inline bool ConstElement::isType(BSONType type) const { - return _basis.isType(type); -} - -inline StringData ConstElement::getFieldName() const { - return _basis.getFieldName(); -} - -inline Element::RepIdx ConstElement::getIdx() const { - return _basis.getIdx(); -} - -inline std::string ConstElement::toString() const { - return _basis.toString(); -} - -inline bool operator==(const ConstElement& l, const ConstElement& r) { - return l._basis == r._basis; -} - -inline bool operator!=(const ConstElement& l, const ConstElement& r) { - return !(l == r); -} - -inline bool operator==(const Element& l, const ConstElement& r) { - return ConstElement(l) == r; -} - -inline bool operator!=(const Element& l, const ConstElement& r) { - return !(l == r); -} - -inline bool operator==(const ConstElement& l, const Element& r) { - return l == ConstElement(r); -} - -inline bool operator!=(const ConstElement& l, const Element& r) { - return !(l == r); -} - - -} // namespace mutablebson -} // namespace mongo diff --git a/src/mongo/db/exec/sbe/stages/fetch.h b/src/mongo/db/exec/sbe/stages/fetch.h index 27d17f1a182..d1bf59ac5f3 100644 --- a/src/mongo/db/exec/sbe/stages/fetch.h +++ b/src/mongo/db/exec/sbe/stages/fetch.h @@ -45,6 +45,7 @@ #include "mongo/db/query/plan_yield_policy.h" #include "mongo/db/record_id.h" #include "mongo/db/storage/record_store.h" +#include "mongo/util/modules.h" #include "mongo/util/string_listset.h" #include "mongo/util/string_map.h" #include "mongo/util/uuid.h" diff --git a/src/mongo/db/exec/sbe/stages/generic_scan.h b/src/mongo/db/exec/sbe/stages/generic_scan.h index 8196b64e5f1..2a1bcc24873 100644 --- a/src/mongo/db/exec/sbe/stages/generic_scan.h +++ b/src/mongo/db/exec/sbe/stages/generic_scan.h @@ -30,6 +30,7 @@ #pragma once #include "mongo/db/exec/sbe/stages/scan.h" +#include "mongo/util/modules.h" #include "mongo/util/uuid.h" #include diff --git a/src/mongo/db/exec/sbe/stages/scan_helpers.h b/src/mongo/db/exec/sbe/stages/scan_helpers.h index ee3c5b97d9a..8af5c7fa71f 100644 --- a/src/mongo/db/exec/sbe/stages/scan_helpers.h +++ b/src/mongo/db/exec/sbe/stages/scan_helpers.h @@ -32,6 +32,7 @@ #include "mongo/db/exec/sbe/values/bson.h" #include "mongo/db/exec/sbe/values/slot.h" #include "mongo/db/storage/record_data.h" +#include "mongo/util/modules.h" #include "mongo/util/string_listset.h" namespace mongo { diff --git a/src/mongo/db/keypattern.idl b/src/mongo/db/keypattern.idl index eaff385d6b0..d5574120190 100644 --- a/src/mongo/db/keypattern.idl +++ b/src/mongo/db/keypattern.idl @@ -32,6 +32,7 @@ global: cpp_namespace: "mongo" cpp_includes: - "mongo/db/keypattern.h" + mod_visibility: public types: KeyPattern: diff --git a/src/mongo/db/matcher/doc_validation/doc_validation_error_test.h b/src/mongo/db/matcher/doc_validation/doc_validation_error_test.h index 2e5aaedc3a1..c9c328a4d1f 100644 --- a/src/mongo/db/matcher/doc_validation/doc_validation_error_test.h +++ b/src/mongo/db/matcher/doc_validation/doc_validation_error_test.h @@ -34,6 +34,7 @@ #include "mongo/db/pipeline/expression_context_for_test.h" #include "mongo/db/query/compiler/parsers/matcher/expression_parser.h" #include "mongo/unittest/unittest.h" +#include "mongo/util/modules.h" namespace mongo::doc_validation_error { /** diff --git a/src/mongo/db/pipeline/document_source_unwind.h b/src/mongo/db/pipeline/document_source_unwind.h index a81dc94827e..c46057141c3 100644 --- a/src/mongo/db/pipeline/document_source_unwind.h +++ b/src/mongo/db/pipeline/document_source_unwind.h @@ -44,6 +44,7 @@ #include "mongo/db/pipeline/variables.h" #include "mongo/db/query/compiler/dependency_analysis/dependencies.h" #include "mongo/db/query/query_shape/serialization_options.h" +#include "mongo/util/modules.h" #include #include @@ -55,7 +56,8 @@ #include #include -namespace mongo { +// TODO SERVER-116044: Remove external dependencies on this header. +namespace MONGO_MOD_NEEDS_REPLACEMENT mongo { DEFINE_LITE_PARSED_STAGE_DEFAULT_DERIVED(Unwind); @@ -167,4 +169,4 @@ private: SbeCompatibility _sbeCompatibility{SbeCompatibility::requiresSbeFull}; }; // class DocumentSourceUnwind -} // namespace mongo +} // namespace MONGO_MOD_NEEDS_REPLACEMENT mongo diff --git a/src/mongo/db/pipeline/value.idl b/src/mongo/db/pipeline/value.idl index 4cea1b595bd..a5136949621 100644 --- a/src/mongo/db/pipeline/value.idl +++ b/src/mongo/db/pipeline/value.idl @@ -30,6 +30,7 @@ global: cpp_namespace: "mongo" cpp_includes: - "mongo/db/exec/document_value/value.h" + mod_visibility: public types: Value: diff --git a/src/mongo/db/query/client_cursor/generic_cursor.h b/src/mongo/db/query/client_cursor/generic_cursor.h index 2f8e06f232f..5692b575f11 100644 --- a/src/mongo/db/query/client_cursor/generic_cursor.h +++ b/src/mongo/db/query/client_cursor/generic_cursor.h @@ -32,6 +32,7 @@ #include "mongo/base/status_with.h" #include "mongo/bson/util/builder.h" #include "mongo/db/query/client_cursor/generic_cursor_gen.h" +#include "mongo/util/modules.h" #include diff --git a/src/mongo/db/query/compiler/optimizer/join/agg_join_model_fixture.h b/src/mongo/db/query/compiler/optimizer/join/agg_join_model_fixture.h index 48d1da69083..792cc6109c9 100644 --- a/src/mongo/db/query/compiler/optimizer/join/agg_join_model_fixture.h +++ b/src/mongo/db/query/compiler/optimizer/join/agg_join_model_fixture.h @@ -31,6 +31,7 @@ #include "mongo/db/pipeline/aggregation_context_fixture.h" #include "mongo/db/query/compiler/optimizer/join/agg_join_model.h" +#include "mongo/util/modules.h" namespace mongo::join_ordering { class AggJoinModelFixture : public AggregationContextFixture { diff --git a/src/mongo/db/query/compiler/optimizer/join/cardinality_estimation_types.h b/src/mongo/db/query/compiler/optimizer/join/cardinality_estimation_types.h index 0de82fffbfc..be15d60289a 100644 --- a/src/mongo/db/query/compiler/optimizer/join/cardinality_estimation_types.h +++ b/src/mongo/db/query/compiler/optimizer/join/cardinality_estimation_types.h @@ -31,6 +31,7 @@ #include "mongo/db/query/compiler/optimizer/cost_based_ranker/estimates.h" #include "mongo/db/query/compiler/optimizer/join/join_graph.h" +#include "mongo/util/modules.h" namespace mongo::join_ordering { /** diff --git a/src/mongo/db/query/compiler/optimizer/join/predicate_extractor.h b/src/mongo/db/query/compiler/optimizer/join/predicate_extractor.h index 3c61fcb6ed1..bad75e7e521 100644 --- a/src/mongo/db/query/compiler/optimizer/join/predicate_extractor.h +++ b/src/mongo/db/query/compiler/optimizer/join/predicate_extractor.h @@ -29,6 +29,7 @@ #include "mongo/db/matcher/expression.h" #include "mongo/db/pipeline/expression.h" +#include "mongo/util/modules.h" namespace mongo::join_ordering { diff --git a/src/mongo/db/query/plan_ranking/cbr_for_no_mp_results.h b/src/mongo/db/query/plan_ranking/cbr_for_no_mp_results.h index a27e8298293..617530860a8 100644 --- a/src/mongo/db/query/plan_ranking/cbr_for_no_mp_results.h +++ b/src/mongo/db/query/plan_ranking/cbr_for_no_mp_results.h @@ -37,6 +37,7 @@ #include "mongo/db/query/plan_yield_policy.h" #include "mongo/db/query/query_planner.h" #include "mongo/db/query/query_planner_params.h" +#include "mongo/util/modules.h" namespace mongo { namespace plan_ranking { diff --git a/src/mongo/db/query/plan_ranking/plan_ranker.h b/src/mongo/db/query/plan_ranking/plan_ranker.h index 67fc12528fa..bb077b8eafc 100644 --- a/src/mongo/db/query/plan_ranking/plan_ranker.h +++ b/src/mongo/db/query/plan_ranking/plan_ranker.h @@ -35,6 +35,7 @@ #include "mongo/db/query/plan_yield_policy.h" #include "mongo/db/query/query_planner.h" #include "mongo/db/query/query_planner_params.h" +#include "mongo/util/modules.h" namespace mongo { diff --git a/src/mongo/db/query/plan_ranking/plan_ranking_test_fixture.h b/src/mongo/db/query/plan_ranking/plan_ranking_test_fixture.h index 7b1d9ad40ec..1ea198ffe57 100644 --- a/src/mongo/db/query/plan_ranking/plan_ranking_test_fixture.h +++ b/src/mongo/db/query/plan_ranking/plan_ranking_test_fixture.h @@ -31,6 +31,7 @@ #include "mongo/db/exec/runtime_planners/planner_interface.h" #include "mongo/db/namespace_string.h" #include "mongo/db/shard_role/shard_catalog/catalog_test_fixture.h" +#include "mongo/util/modules.h" namespace mongo { namespace plan_ranking { diff --git a/src/mongo/db/query/query_shape/update_cmd_builder.h b/src/mongo/db/query/query_shape/update_cmd_builder.h index 50d9ef55c37..ed717de11a9 100644 --- a/src/mongo/db/query/query_shape/update_cmd_builder.h +++ b/src/mongo/db/query/query_shape/update_cmd_builder.h @@ -31,6 +31,7 @@ #include "mongo/bson/bsonobj.h" #include "mongo/bson/bsonobjbuilder.h" +#include "mongo/util/modules.h" #include diff --git a/src/mongo/db/query/stage_builder/sbe/abt/syntax/syntax_fwd_declare.h b/src/mongo/db/query/stage_builder/sbe/abt/syntax/syntax_fwd_declare.h index 15949fd114f..03d22511089 100644 --- a/src/mongo/db/query/stage_builder/sbe/abt/syntax/syntax_fwd_declare.h +++ b/src/mongo/db/query/stage_builder/sbe/abt/syntax/syntax_fwd_declare.h @@ -29,6 +29,8 @@ #pragma once +#include "mongo/util/modules.h" + namespace mongo::abt { /** diff --git a/src/mongo/db/query/stage_builder/sbe/abt_defs.h b/src/mongo/db/query/stage_builder/sbe/abt_defs.h index 5fdeb9e4ca5..322454c105b 100644 --- a/src/mongo/db/query/stage_builder/sbe/abt_defs.h +++ b/src/mongo/db/query/stage_builder/sbe/abt_defs.h @@ -31,3 +31,4 @@ #include "mongo/db/query/stage_builder/sbe/abt/syntax/expr.h" #include "mongo/db/query/stage_builder/sbe/abt/syntax/syntax.h" +#include "mongo/util/modules.h" diff --git a/src/mongo/db/query/stage_builder/sbe/sbexpr_helpers.h b/src/mongo/db/query/stage_builder/sbe/sbexpr_helpers.h index 93e54a8207d..0e185004582 100644 --- a/src/mongo/db/query/stage_builder/sbe/sbexpr_helpers.h +++ b/src/mongo/db/query/stage_builder/sbe/sbexpr_helpers.h @@ -37,7 +37,7 @@ #include "mongo/db/query/stage_builder/sbe/builder_state.h" #include "mongo/db/query/stage_builder/sbe/gen_abt_helpers.h" #include "mongo/db/query/stage_builder/sbe/sbexpr.h" - +#include "mongo/util/modules.h" namespace mongo::stage_builder { inline void makeSbExprOptSbSlotVecHelper(SbExprOptSlotVector& result) {} diff --git a/src/mongo/db/query/stage_memory_limit_knobs/knobs_protector.h b/src/mongo/db/query/stage_memory_limit_knobs/knobs_protector.h index 445916d5b3e..0a3f156d7e2 100644 --- a/src/mongo/db/query/stage_memory_limit_knobs/knobs_protector.h +++ b/src/mongo/db/query/stage_memory_limit_knobs/knobs_protector.h @@ -29,6 +29,8 @@ #pragma once +#include "mongo/util/modules.h" + #ifndef QUERY_STAGE_MEMORY_LIMITS_KNOBS_PRIVATE_OVERRIDE #error \ "mongo/db/query/stage_memory_limit_knobs/stage_memory_limit_knobs_gen.h must not be used directly. Use the interface provided by mongo/db/query/stage_memory_limit_knobs/knobs.h" diff --git a/src/mongo/db/stats/OWNERS.yml b/src/mongo/db/stats/OWNERS.yml index 2b3b5c8cb5b..384a30a4abd 100644 --- a/src/mongo/db/stats/OWNERS.yml +++ b/src/mongo/db/stats/OWNERS.yml @@ -37,3 +37,6 @@ filters: - "timer_stats*": approvers: - 10gen/server-programmability + - "counter_ops.h": + approvers: + - 10gen/server-programmability diff --git a/src/mongo/db/stats/counter_ops.h b/src/mongo/db/stats/counter_ops.h index 96ff05d290d..89142654176 100644 --- a/src/mongo/db/stats/counter_ops.h +++ b/src/mongo/db/stats/counter_ops.h @@ -30,10 +30,11 @@ #pragma once #include "mongo/platform/atomic_word.h" +#include "mongo/util/modules.h" #include -namespace mongo { +namespace MONGO_MOD_PUBLIC mongo { /** * Helper functions to operate on AtomicWord and int64_t interchangibly. @@ -76,4 +77,4 @@ static void add(AtomicWord& counter, int64_t value) { } }; // namespace counter_ops -} // namespace mongo +} // namespace MONGO_MOD_PUBLIC mongo diff --git a/src/mongo/db/stats/read_concern_stats.idl b/src/mongo/db/stats/read_concern_stats.idl index 1eac634618d..d41fe2bbbc4 100644 --- a/src/mongo/db/stats/read_concern_stats.idl +++ b/src/mongo/db/stats/read_concern_stats.idl @@ -32,6 +32,7 @@ global: cpp_namespace: "mongo" + mod_visibility: public imports: - "mongo/db/basic_types.idl" diff --git a/src/mongo/db/stats/read_preference_metrics.idl b/src/mongo/db/stats/read_preference_metrics.idl index c256be4c02b..a84defd53d2 100644 --- a/src/mongo/db/stats/read_preference_metrics.idl +++ b/src/mongo/db/stats/read_preference_metrics.idl @@ -32,6 +32,7 @@ global: cpp_namespace: "mongo" + mod_visibility: public imports: - "mongo/client/read_preference.idl" diff --git a/src/mongo/db/stats/system_buckets_metrics.h b/src/mongo/db/stats/system_buckets_metrics.h index 70cb17a00f1..a1d949ddaef 100644 --- a/src/mongo/db/stats/system_buckets_metrics.h +++ b/src/mongo/db/stats/system_buckets_metrics.h @@ -31,8 +31,9 @@ #include "mongo/db/commands.h" #include "mongo/logv2/log_severity_suppressor.h" +#include "mongo/util/modules.h" -namespace mongo { +namespace MONGO_MOD_PUBLIC mongo { /** * A CommandInvocation hooks to track commands directly targeting system.buckets collections. @@ -50,4 +51,4 @@ public: Hours{1}, logv2::LogSeverity::Info(), logv2::LogSeverity::Debug(2)}; }; -} // namespace mongo +} // namespace MONGO_MOD_PUBLIC mongo diff --git a/src/mongo/db/update/update_node_test_fixture.h b/src/mongo/db/update/update_node_test_fixture.h index 9eb977d5934..f5e64059412 100644 --- a/src/mongo/db/update/update_node_test_fixture.h +++ b/src/mongo/db/update/update_node_test_fixture.h @@ -36,6 +36,7 @@ #include "mongo/db/update/update_oplog_entry_serialization.h" #include "mongo/db/update/v2_log_builder.h" #include "mongo/unittest/unittest.h" +#include "mongo/util/modules.h" namespace mongo { diff --git a/src/mongo/s/query/exec/document_source_merge_cursors.h b/src/mongo/s/query/exec/document_source_merge_cursors.h index 43da48de0f9..84da4d91d91 100644 --- a/src/mongo/s/query/exec/document_source_merge_cursors.h +++ b/src/mongo/s/query/exec/document_source_merge_cursors.h @@ -47,6 +47,7 @@ #include "mongo/s/query/exec/router_stage_merge.h" #include "mongo/stdx/unordered_set.h" #include "mongo/util/duration.h" +#include "mongo/util/modules.h" #include #include @@ -57,7 +58,8 @@ #include #include -namespace mongo { +// TODO SERVER-111290: Remove 'CheckMetadataConsistencyCmd' dependency on this header. +namespace MONGO_MOD_NEEDS_REPLACEMENT mongo { DEFINE_LITE_PARSED_STAGE_INTERNAL_DERIVED(MergeCursors); @@ -194,4 +196,4 @@ private: bool _ownCursors = true; }; -} // namespace mongo +} // namespace MONGO_MOD_NEEDS_REPLACEMENT mongo diff --git a/src/mongo/s/query/shard_targeting_helpers.h b/src/mongo/s/query/shard_targeting_helpers.h index 903f6255001..c9851e180ac 100644 --- a/src/mongo/s/query/shard_targeting_helpers.h +++ b/src/mongo/s/query/shard_targeting_helpers.h @@ -32,6 +32,7 @@ #include "mongo/db/pipeline/expression_context.h" #include "mongo/db/router_role/routing_cache/catalog_cache.h" #include "mongo/db/sharding_environment/shard_id.h" +#include "mongo/util/modules.h" namespace mongo { diff --git a/src/mongo/s/write_ops/write_op_helper.h b/src/mongo/s/write_ops/write_op_helper.h index 7b23f75bdeb..04ed43a08c2 100644 --- a/src/mongo/s/write_ops/write_op_helper.h +++ b/src/mongo/s/write_ops/write_op_helper.h @@ -33,6 +33,7 @@ #include "mongo/db/commands/query_cmd/bulk_write_crud_op.h" #include "mongo/db/commands/query_cmd/bulk_write_parser.h" #include "mongo/s/write_ops/write_command_ref.h" +#include "mongo/util/modules.h" namespace mongo { namespace write_op_helpers {