Skip to content

Commit db11c95

Browse files
committed
SERVER-18101 Remove usage of default_version.cpp
1 parent 66c8239 commit db11c95

15 files changed

+91
-144
lines changed

src/mongo/SConscript

Lines changed: 59 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -871,57 +871,67 @@ quick_exit_env.Library(target='quick_exit',
871871
'util/quick_exit.cpp',
872872
])
873873

874-
env.Library('coreshard',
875-
[
876-
# This is only here temporarily for auto-split logic in chunk.cpp.
877-
's/balancer_policy.cpp',
878-
's/distlock.cpp',
879-
's/config.cpp',
880-
's/grid.cpp',
881-
's/chunk.cpp',
882-
's/chunk_manager.cpp',
883-
's/config_server_checker_service.cpp',
884-
's/shard_key_pattern.cpp'
885-
],
886-
LIBDEPS=[
887-
'$BUILD_DIR/mongo/s/base',
888-
'$BUILD_DIR/mongo/s/client/sharding_client',
889-
'$BUILD_DIR/mongo/s/cluster_ops_impl',
890-
])
891-
892-
env.Library('mongoscore',
893-
[
894-
's/balance.cpp',
895-
's/cluster_last_error_info.cpp',
896-
's/cursors.cpp',
897-
's/request.cpp',
898-
's/s_only.cpp',
899-
's/strategy.cpp',
900-
's/version_manager.cpp',
901-
's/version_mongos.cpp',
902-
],
903-
LIBDEPS=[
904-
'db/auth/authmongos',
905-
'db/fts/ftsmongos',
906-
'db/query/explain_common',
907-
'db/query/lite_parsed_query',
908-
's/cluster_ops',
909-
's/cluster_write_op_conversion',
910-
])
874+
# This library contains sharding functionality used by both mongod and mongos. Certain tests,
875+
# which exercise this functionality also link against it.
876+
env.Library(
877+
target='coreshard',
878+
source=[
879+
# This is only here temporarily for auto-split logic in chunk.cpp.
880+
's/balancer_policy.cpp',
881+
's/distlock.cpp',
882+
's/config.cpp',
883+
's/grid.cpp',
884+
's/chunk.cpp',
885+
's/chunk_manager.cpp',
886+
's/config_server_checker_service.cpp',
887+
's/shard_key_pattern.cpp',
888+
's/version_manager.cpp',
889+
],
890+
LIBDEPS=[
891+
's/base',
892+
's/client/sharding_client',
893+
's/cluster_ops_impl',
894+
]
895+
)
911896

912-
env.CppUnitTest("mongoscore_test",
913-
["s/shard_key_pattern_test.cpp",
914-
"s/balancing_window_test.cpp",
915-
"s/balancer_policy_tests.cpp",
916-
],
917-
LIBDEPS=["mongoscore",
918-
"coreshard",
919-
"mongocommon",
920-
"coreserver",
921-
"coredb"])
897+
# This library is only used by the mongos execuable and any tests which require mongos runtime
898+
# objects, such as the request processing pipeline or the balancer.
899+
env.Library(
900+
target='mongoscore',
901+
source=[
902+
's/balance.cpp',
903+
's/cluster_last_error_info.cpp',
904+
's/cursors.cpp',
905+
's/request.cpp',
906+
's/s_only.cpp',
907+
's/strategy.cpp',
908+
's/version_mongos.cpp',
909+
],
910+
LIBDEPS=[
911+
'db/auth/authmongos',
912+
'db/fts/ftsmongos',
913+
'db/query/explain_common',
914+
'db/query/lite_parsed_query',
915+
's/cluster_ops',
916+
's/cluster_write_op_conversion',
917+
]
918+
)
922919

923-
env.CppUnitTest("dbclient_rs_test", [ "client/dbclient_rs_test.cpp" ],
924-
LIBDEPS=['$BUILD_DIR/mongo/client/clientdriver', 'mocklib'])
920+
env.CppUnitTest(
921+
target='mongoscore_test',
922+
source=[
923+
's/shard_key_pattern_test.cpp',
924+
's/balancing_window_test.cpp',
925+
's/balancer_policy_tests.cpp',
926+
],
927+
LIBDEPS=[
928+
'mongoscore',
929+
'coreshard',
930+
'mongocommon',
931+
'coreserver',
932+
'coredb',
933+
]
934+
)
925935

926936
env.CppUnitTest("scoped_db_conn_test", [ "client/scoped_db_conn_test.cpp" ],
927937
LIBDEPS=[
@@ -934,15 +944,6 @@ env.CppUnitTest("scoped_db_conn_test", [ "client/scoped_db_conn_test.cpp" ],
934944
"ntservice_mock"],
935945
NO_CRUTCH=True)
936946

937-
env.CppUnitTest("shard_test", [ "s/shard_test.cpp" ],
938-
LIBDEPS=[ "mongoscore",
939-
"coreshard",
940-
"mongocommon",
941-
"coreserver",
942-
"coredb",
943-
"message_server_port",
944-
"mocklib"])
945-
946947
env.CppUnitTest('config_server_tests', [ 's/config_server_tests.cpp' ],
947948
LIBDEPS=[ "mongoscore",
948949
"coreshard",
@@ -969,8 +970,6 @@ if has_option( 'use-cpu-profiler' ):
969970
# just to this file.
970971
env.InjectThirdPartyIncludePaths('tcmalloc')
971972

972-
env.Library("defaultversion", "s/default_version.cpp")
973-
974973
env.CppUnitTest(
975974
target="index_filter_commands_test",
976975
source=[
@@ -1043,7 +1042,6 @@ serveronlyLibdeps = ["coreshard",
10431042
"db/concurrency/lock_manager",
10441043
"db/concurrency/write_conflict_exception",
10451044
"db/ops/update_driver",
1046-
"defaultversion",
10471045
"global_timestamp",
10481046
"index_key_validate",
10491047
'range_deleter',

src/mongo/client/SConscript

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ env.Library('clientdriver', [
3535

3636
env.CppUnitTest("replica_set_monitor_test",
3737
["replica_set_monitor_test.cpp"],
38-
LIBDEPS=["clientdriver"])
38+
LIBDEPS=["clientdriver"])
39+
40+
env.CppUnitTest("dbclient_rs_test",
41+
["dbclient_rs_test.cpp"],
42+
LIBDEPS=['clientdriver', '$BUILD_DIR/mongo/mocklib'])

src/mongo/db/server_options_helpers.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,4 @@ namespace {
953953
return Status::OK();
954954
}
955955

956-
// FIXME: This function will not return the correct value if someone renames the mongos binary
957-
bool isMongos() { return serverGlobalParams.binaryName == "mongos"; }
958-
959956
} // namespace mongo

src/mongo/db/server_options_helpers.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,4 @@ namespace mongo {
6767

6868
void printCommandLineOpts();
6969

70-
// This function should eventually go away, but needs to be here now because we have a lot of
71-
// code that is shared between mongod and mongos that must know at runtime which binary it is in
72-
bool isMongos();
73-
7470
} // namespace mongo

src/mongo/db/sorter/sorter.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#include "mongo/db/jsobj.h"
5858
#include "mongo/db/storage_options.h"
5959
#include "mongo/platform/atomic_word.h"
60+
#include "mongo/s/mongos_options.h"
6061
#include "mongo/util/assert_util.h"
6162
#include "mongo/util/bufreader.h"
6263
#include "mongo/util/mongoutils/str.h"

src/mongo/db/storage_options.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,4 @@ namespace mongo {
106106

107107
extern StorageGlobalParams storageGlobalParams;
108108

109-
// This is not really related to persistence, but mongos and the other executables share code
110-
// and we use this function to determine at runtime which executable we are in.
111-
bool isMongos();
112-
113109
} // namespace mongo

src/mongo/s/SConscript

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ env.CppUnitTest(
198198
'cluster_ops',
199199
'cluster_write_op_conversion',
200200
'$BUILD_DIR/mongo/db/common',
201-
'$BUILD_DIR/mongo/server_options', # DbMessage needs server options
202-
"$BUILD_DIR/mongo/client/clientdriver",
201+
'$BUILD_DIR/mongo/client/clientdriver',
203202
]
204203
)
205204

src/mongo/s/client/SConscript

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ env.CppUnitTest(
3232
target='sharding_client_test',
3333
source=[
3434
'multi_host_query_test.cpp',
35-
'shard_connection_test.cpp'
35+
'shard_connection_test.cpp',
36+
'shard_test.cpp',
3637
],
3738
LIBDEPS=[
3839
'sharding_client',

src/mongo/s/client/shard_connection.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,9 @@ namespace {
491491

492492
void ShardConnection::kill() {
493493
if ( _conn ) {
494-
if( versionManager.isVersionableCB( _conn ) ) versionManager.resetShardVersionCB( _conn );
494+
if (versionManager.isVersionableCB(_conn)) {
495+
versionManager.resetShardVersionCB(_conn);
496+
}
495497

496498
if (_conn->isFailed()) {
497499
// Let the pool know about the bad connection and also delegate disposal to it.
File renamed without changes.

0 commit comments

Comments
 (0)