Got a duplicate symbol error for some functions in WaitForMajorityServiceWaitForMajorityService.
This is the SCONS command I had used (note that I did not regenerate Scons after git pulling):
./buildscripts/scons.py --variables-files=etc/scons/mongodbtoolchain_v3_clang.vars --ninja generate-ninja ICECC=icecc CCACHE=ccache
And the Ninja command I invoked:
ninja -j400 install-core
I was at git commit 6c0ac0678f3c159c65c497acf155e964dec43f61 on branch master of mongodb/mongo.
I've also attached my build.ninja file to the ticket.
Here's the full error:
FAILED: build/opt/mongo/mongod PATH=/opt/mongodbtoolchain/v3/bin:/usr/local/bin:/opt/bin:/bin:/usr/bin ICECC_CLANG_REMOTE_CPP=1 CCACHE_NOCPP2=1 ICECC_VERSION=/home/ubuntu/mongo/build/scons/icecc/opt_mongodbtoolchain_v3_bin_clang_opt_mongodbtoolchain_v3_bin_clang++.tar.gz CCACHE_PREFIX=/usr/bin/icecc /usr/bin/icerun /opt/mongodbtoolchain/v3/bin/clang++ @build/opt/mongo/mongod.rsp ld.lld: error: duplicate symbol: mongo::WaitForMajorityService::waitUntilMajority(mongo::repl::OpTime const&) >>> defined at wait_for_majority_service.cpp:101 (src/mongo/db/s/wait_for_majority_service.cpp:101) >>> wait_for_majority_service.o:(mongo::WaitForMajorityService::waitUntilMajority(mongo::repl::OpTime const&)) in archive build/opt/mongo/db/s/libtransaction_coordinator.a >>> defined at wait_for_majority_service.cpp:101 (src/mongo/db/repl/wait_for_majority_service.cpp:101) >>> wait_for_majority_service.o:(.text+0x510) in archive build/opt/mongo/db/repl/libwait_for_majority_service.ald.lld: error: duplicate symbol: mongo::WaitForMajorityService::_periodicallyWaitForMajority(mongo::ServiceContext*) >>> defined at wait_for_majority_service.cpp:145 (src/mongo/db/s/wait_for_majority_service.cpp:145) >>> wait_for_majority_service.o:(mongo::WaitForMajorityService::_periodicallyWaitForMajority(mongo::ServiceContext*)) in archive build/opt/mongo/db/s/libtransaction_coordinator.a >>> defined at wait_for_majority_service.cpp:145 (src/mongo/db/repl/wait_for_majority_service.cpp:145) >>> wait_for_majority_service.o:(.text+0xA50) in archive build/opt/mongo/db/repl/libwait_for_majority_service.ald.lld: error: duplicate symbol: mongo::WaitForMajorityService::get(mongo::ServiceContext*) >>> defined at wait_for_majority_service.cpp:61 (src/mongo/db/s/wait_for_majority_service.cpp:61) >>> wait_for_majority_service.o:(mongo::WaitForMajorityService::get(mongo::ServiceContext*)) in archive build/opt/mongo/db/s/libtransaction_coordinator.a >>> defined at wait_for_majority_service.cpp:61 (src/mongo/db/repl/wait_for_majority_service.cpp:61) >>> wait_for_majority_service.o:(.text+0x3C0) in archive build/opt/mongo/db/repl/libwait_for_majority_service.ald.lld: error: duplicate symbol: mongo::WaitForMajorityService::setUp(mongo::ServiceContext*) >>> defined at wait_for_majority_service.cpp:65 (src/mongo/db/s/wait_for_majority_service.cpp:65) >>> wait_for_majority_service.o:(mongo::WaitForMajorityService::setUp(mongo::ServiceContext*)) in archive build/opt/mongo/db/s/libtransaction_coordinator.a >>> defined at wait_for_majority_service.cpp:65 (src/mongo/db/repl/wait_for_majority_service.cpp:65) >>> wait_for_majority_service.o:(.text+0x3D0) in archive build/opt/mongo/db/repl/libwait_for_majority_service.ald.lld: error: duplicate symbol: mongo::WaitForMajorityService::shutDown() >>> defined at wait_for_majority_service.cpp:73 (src/mongo/db/s/wait_for_majority_service.cpp:73) >>> wait_for_majority_service.o:(mongo::WaitForMajorityService::shutDown()) in archive build/opt/mongo/db/s/libtransaction_coordinator.a >>> defined at wait_for_majority_service.cpp:73 (src/mongo/db/repl/wait_for_majority_service.cpp:73) >>> wait_for_majority_service.o:(.text+0x130) in archive build/opt/mongo/db/repl/libwait_for_majority_service.ald.lld: error: duplicate symbol: mongo::WaitForMajorityService::~WaitForMajorityService() >>> defined at wait_for_majority_service.cpp:57 (src/mongo/db/s/wait_for_majority_service.cpp:57) >>> wait_for_majority_service.o:(mongo::WaitForMajorityService::~WaitForMajorityService()) in archive build/opt/mongo/db/s/libtransaction_coordinator.a >>> defined at wait_for_majority_service.cpp:57 (src/mongo/db/repl/wait_for_majority_service.cpp:57) >>> wait_for_majority_service.o:(.text+0x0) in archive build/opt/mongo/db/repl/libwait_for_majority_service.ald.lld: error: duplicate symbol: mongo::WaitForMajorityService::~WaitForMajorityService() >>> defined at wait_for_majority_service.cpp:57 (src/mongo/db/s/wait_for_majority_service.cpp:57) >>> wait_for_majority_service.o:(mongo::WaitForMajorityService::~WaitForMajorityService()) in archive build/opt/mongo/db/s/libtransaction_coordinator.a >>> defined at wait_for_majority_service.cpp:57 (src/mongo/db/repl/wait_for_majority_service.cpp:57) >>> wait_for_majority_service.o:(.text+0x0) in archive build/opt/mongo/db/repl/libwait_for_majority_service.a clang-7: error: linker command failed with exit code 1 (use -v to see invocation) ninja: build stopped: subcommand failed.