diff options
author | Sara Golemon <sara.golemon@mongodb.com> | 2019-02-28 18:43:22 +0000 |
---|---|---|
committer | Sara Golemon <sara.golemon@mongodb.com> | 2019-02-28 23:31:15 +0000 |
commit | e33301994172d80c0f4e62bd3b01fa41f35561ec (patch) | |
tree | 0c755dbe3c5f3c008fcd49ed74f6e4caa2a8ac26 | |
parent | 2cefba4860da094c5e26475b68a003150ccfd8f5 (diff) | |
download | mongo-e33301994172d80c0f4e62bd3b01fa41f35561ec.tar.gz |
SERVER-39740 Migrate set parameters in cluster_query_knobs to IDL
-rw-r--r-- | src/mongo/db/pipeline/mongos_process_interface.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/pipeline/sharded_agg_helpers.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/query/SConscript | 5 | ||||
-rw-r--r-- | src/mongo/s/query/cluster_aggregate.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/query/cluster_aggregation_planner.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/query/cluster_find.cpp | 1 | ||||
-rw-r--r-- | src/mongo/s/query/cluster_query_knobs.cpp | 42 | ||||
-rw-r--r-- | src/mongo/s/query/cluster_query_knobs.h | 52 | ||||
-rw-r--r-- | src/mongo/s/query/cluster_query_knobs.idl | 60 |
9 files changed, 67 insertions, 100 deletions
diff --git a/src/mongo/db/pipeline/mongos_process_interface.cpp b/src/mongo/db/pipeline/mongos_process_interface.cpp index 758ce2bda70..0683a7d4ef9 100644 --- a/src/mongo/db/pipeline/mongos_process_interface.cpp +++ b/src/mongo/db/pipeline/mongos_process_interface.cpp @@ -46,7 +46,6 @@ #include "mongo/s/cluster_commands_helpers.h" #include "mongo/s/grid.h" #include "mongo/s/query/cluster_cursor_manager.h" -#include "mongo/s/query/cluster_query_knobs.h" #include "mongo/s/query/establish_cursors.h" #include "mongo/s/query/router_exec_stage.h" #include "mongo/s/transaction_router.h" diff --git a/src/mongo/db/pipeline/sharded_agg_helpers.cpp b/src/mongo/db/pipeline/sharded_agg_helpers.cpp index d5bce605c9d..2128cfeb63f 100644 --- a/src/mongo/db/pipeline/sharded_agg_helpers.cpp +++ b/src/mongo/db/pipeline/sharded_agg_helpers.cpp @@ -37,7 +37,7 @@ #include "mongo/db/pipeline/document_source_out.h" #include "mongo/s/catalog_cache.h" #include "mongo/s/cluster_commands_helpers.h" -#include "mongo/s/query/cluster_query_knobs.h" +#include "mongo/s/query/cluster_query_knobs_gen.h" #include "mongo/s/query/document_source_merge_cursors.h" #include "mongo/s/transaction_router.h" #include "mongo/util/fail_point.h" diff --git a/src/mongo/s/query/SConscript b/src/mongo/s/query/SConscript index 08042d1f9f9..11ab78e5cb5 100644 --- a/src/mongo/s/query/SConscript +++ b/src/mongo/s/query/SConscript @@ -8,7 +8,7 @@ env.Library( target="cluster_query", source=[ "cluster_find.cpp", - "cluster_query_knobs.cpp", + env.Idlc('cluster_query_knobs.idl')[0], ], LIBDEPS=[ '$BUILD_DIR/mongo/db/commands', @@ -20,6 +20,9 @@ env.Library( "cluster_cursor_cleanup_job", "store_possible_cursor", ], + LIBDEPS_PRIVATE=[ + '$BUILD_DIR/mongo/idl/server_parameter', + ], ) env.Library( diff --git a/src/mongo/s/query/cluster_aggregate.cpp b/src/mongo/s/query/cluster_aggregate.cpp index 1012c6baaf6..177d1832f07 100644 --- a/src/mongo/s/query/cluster_aggregate.cpp +++ b/src/mongo/s/query/cluster_aggregate.cpp @@ -66,7 +66,7 @@ #include "mongo/s/query/cluster_client_cursor_impl.h" #include "mongo/s/query/cluster_client_cursor_params.h" #include "mongo/s/query/cluster_cursor_manager.h" -#include "mongo/s/query/cluster_query_knobs.h" +#include "mongo/s/query/cluster_query_knobs_gen.h" #include "mongo/s/query/document_source_merge_cursors.h" #include "mongo/s/query/establish_cursors.h" #include "mongo/s/query/owned_remote_cursor.h" diff --git a/src/mongo/s/query/cluster_aggregation_planner.cpp b/src/mongo/s/query/cluster_aggregation_planner.cpp index c5f917cfca7..d115bbe382e 100644 --- a/src/mongo/s/query/cluster_aggregation_planner.cpp +++ b/src/mongo/s/query/cluster_aggregation_planner.cpp @@ -44,7 +44,7 @@ #include "mongo/s/catalog_cache.h" #include "mongo/s/cluster_commands_helpers.h" #include "mongo/s/grid.h" -#include "mongo/s/query/cluster_query_knobs.h" +#include "mongo/s/query/cluster_query_knobs_gen.h" #include "mongo/s/query/document_source_merge_cursors.h" #include "mongo/s/query/document_source_update_on_add_shard.h" #include "mongo/s/query/owned_remote_cursor.h" diff --git a/src/mongo/s/query/cluster_find.cpp b/src/mongo/s/query/cluster_find.cpp index 7114db38a65..a41d5a789d7 100644 --- a/src/mongo/s/query/cluster_find.cpp +++ b/src/mongo/s/query/cluster_find.cpp @@ -58,7 +58,6 @@ #include "mongo/s/query/async_results_merger.h" #include "mongo/s/query/cluster_client_cursor_impl.h" #include "mongo/s/query/cluster_cursor_manager.h" -#include "mongo/s/query/cluster_query_knobs.h" #include "mongo/s/query/establish_cursors.h" #include "mongo/s/query/store_possible_cursor.h" #include "mongo/s/stale_exception.h" diff --git a/src/mongo/s/query/cluster_query_knobs.cpp b/src/mongo/s/query/cluster_query_knobs.cpp deleted file mode 100644 index c9fb78dd40f..00000000000 --- a/src/mongo/s/query/cluster_query_knobs.cpp +++ /dev/null @@ -1,42 +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 - * <http://www.mongodb.com/licensing/server-side-public-license>. - * - * 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. - */ - -#include "mongo/platform/basic.h" - -#include "mongo/s/query/cluster_query_knobs.h" - -#include "mongo/db/server_parameters.h" - -namespace mongo { - -MONGO_EXPORT_SERVER_PARAMETER(internalQueryAlwaysMergeOnPrimaryShard, bool, false); -MONGO_EXPORT_SERVER_PARAMETER(internalQueryProhibitMergingOnMongoS, bool, false); -MONGO_EXPORT_SERVER_PARAMETER(internalQueryDisableExchange, bool, false); - -} // namespace mongo diff --git a/src/mongo/s/query/cluster_query_knobs.h b/src/mongo/s/query/cluster_query_knobs.h deleted file mode 100644 index 09ed4a858b9..00000000000 --- a/src/mongo/s/query/cluster_query_knobs.h +++ /dev/null @@ -1,52 +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 - * <http://www.mongodb.com/licensing/server-side-public-license>. - * - * 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 - -#include "mongo/platform/atomic_word.h" - -namespace mongo { - -// If set to true on mongos, all aggregations delivered to the mongos which require a merging shard -// will select the primary shard as the merger. False by default, which means that the merging shard -// will be selected randomly amongst the shards participating in the query. Pipelines capable of -// merging on mongoS are unaffected by this setting, unless internalQueryProhibitMergingOnMongoS is -// true. -extern AtomicWord<bool> internalQueryAlwaysMergeOnPrimaryShard; - -// If set to true on mongos, all aggregations which could otherwise merge on the mongos will be -// obliged to merge on a shard instead. Pipelines which are redirected to the shards will obey the -// value of internalQueryAlwaysMergeOnPrimaryShard. False by default, meaning that pipelines capable -// of merging on mongoS will always do so. -extern AtomicWord<bool> internalQueryProhibitMergingOnMongoS; - -// If set to true on mongos then the cluster query planner will not produce plans with the exchange. -// False by default, so the queries run with exchanges. -extern AtomicWord<bool> internalQueryDisableExchange; -} // namespace mongo diff --git a/src/mongo/s/query/cluster_query_knobs.idl b/src/mongo/s/query/cluster_query_knobs.idl new file mode 100644 index 00000000000..2a8a6936234 --- /dev/null +++ b/src/mongo/s/query/cluster_query_knobs.idl @@ -0,0 +1,60 @@ +# Copyright (C) 2019-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 +# <http://www.mongodb.com/licensing/server-side-public-license>. +# +# 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. +# + +global: + cpp_namespace: "mongo" + +server_parameters: + internalQueryAlwaysMergeOnPrimaryShard: + description: >- + If set to true on mongos, all aggregations delivered to the mongos which require a merging shard + will select the primary shard as the merger. False by default, which means that the merging shard + will be selected randomly amongst the shards participating in the query. Pipelines capable of + merging on mongoS are unaffected by this setting, unless internalQueryProhibitMergingOnMongoS is true. + cpp_vartype: AtomicWord<bool> + cpp_varname: internalQueryAlwaysMergeOnPrimaryShard + set_at: [ startup, runtime ] + default: false + internalQueryProhibitMergingOnMongoS: + description: >- + If set to true on mongos, all aggregations which could otherwise merge on the mongos will be + obliged to merge on a shard instead. Pipelines which are redirected to the shards will obey the + value of internalQueryAlwaysMergeOnPrimaryShard. False by default, meaning that pipelines capable + of merging on mongoS will always do so. + cpp_vartype: AtomicWord<bool> + cpp_varname: internalQueryProhibitMergingOnMongoS + set_at: [ startup, runtime ] + default: false + internalQueryDisableExchange: + description: >- + If set to true on mongos then the cluster query planner will not produce plans with the exchange. + False by default, so the queries run with exchanges. + cpp_vartype: AtomicWord<bool> + cpp_varname: internalQueryDisableExchange + set_at: [ startup, runtime ] + default: false |