The following issues were found
src/mongo/db/s/resharding/resharding_oplog_batch_applier_test.cpp
1 issues
Line: 341
std::unique_ptr<ReshardingOplogBatchApplier> _batchApplier;
};
TEST_F(ReshardingOplogBatchApplierTest, WaitsOnPreparedTxnAndAutomaticallyRetries) {
auto lsid = makeLogicalSessionIdForTest();
TxnNumber existingTxnNumber = 100;
auto opTime = [&] {
Reported by Cppcheck.
src/mongo/db/s/resharding/resharding_oplog_batch_preparer_test.cpp
1 issues
Line: 150
int(kNumWriterVectors)};
};
TEST_F(ReshardingOplogBatchPreparerTest, AssignsCrudOpsToWriterVectorsById) {
OplogBatch batch;
int numOps = 10;
for (int i = 0; i < numOps; ++i) {
batch.emplace_back(makeUpdateOp(BSON("_id" << 0 << "n" << i)));
Reported by Cppcheck.
src/mongo/db/s/resharding/resharding_oplog_crud_application_test.cpp
1 issues
Line: 300
std::unique_ptr<ReshardingMetrics> _metrics;
};
TEST_F(ReshardingOplogCrudApplicationTest, InsertOpInsertsIntoOuputCollection) {
// This case tests applying rule #2 described in
// ReshardingOplogApplicationRules::_applyInsert_inlock.
{
auto opCtx = makeOperationContext();
ASSERT_OK(applier()->applyOperation(opCtx.get(), makeInsertOp(BSON("_id" << 1))));
Reported by Cppcheck.
src/mongo/db/s/resharding/resharding_oplog_fetcher_test.cpp
1 issues
Line: 350
}
};
TEST_F(ReshardingOplogFetcherTest, TestBasic) {
const NamespaceString outputCollectionNss("dbtests.outputCollection");
const NamespaceString dataCollectionNss("dbtests.runFetchIteration");
setupBasic(outputCollectionNss, dataCollectionNss, _destinationShard);
Reported by Cppcheck.
src/mongo/db/s/resharding/resharding_oplog_session_application_test.cpp
1 issues
Line: 263
}
};
TEST_F(ReshardingOplogSessionApplicationTest, IncomingRetryableWriteForNewSession) {
auto lsid = makeLogicalSessionIdForTest();
TxnNumber incomingTxnNumber = 100;
StmtId incomingStmtId = 2;
Reported by Cppcheck.
src/mongo/db/s/resharding/resharding_recipient_service_external_state_test.cpp
1 issues
Line: 248
}
};
TEST_F(RecipientServiceExternalStateTest, ReshardingConfigServerUpdatesHaveNoTimeout) {
RecipientStateMachineExternalStateImpl externalState;
auto future = launchAsync([&] {
externalState.updateCoordinatorDocument(operationContext(),
BSON("query"
Reported by Cppcheck.
src/mongo/db/s/resharding/resharding_recipient_service_test.cpp
1 issues
Line: 324
std::shared_ptr<RecipientStateTransitionController> _controller;
};
TEST_F(ReshardingRecipientServiceTest, CanTransitionThroughEachStateToCompletion) {
for (bool isAlsoDonor : {false, true}) {
LOGV2(5551105,
"Running case",
"test"_attr = _agent.getTestName(),
"isAlsoDonor"_attr = isAlsoDonor);
Reported by Cppcheck.
src/mongo/db/s/resharding/resharding_txn_cloner_test.cpp
1 issues
Line: 487
RAIIServerParameterControllerForTest controller{"reshardingTxnClonerProgressBatchSize", 1};
};
TEST_F(ReshardingTxnClonerTest, MergeTxnNotOnRecipient) {
for (auto state : getDurableTxnStatesAndBoostNone()) {
auto executor = makeTaskExecutorForCloner();
ReshardingTxnCloner cloner(kTwoSourceIdList[1], Timestamp::max());
auto future = runCloner(cloner, executor, executor);
Reported by Cppcheck.
src/mongo/db/s/resharding/resharding_util_test.cpp
1 issues
Line: 99
};
// Confirm the highest minFetchTimestamp is properly computed.
TEST(ReshardingUtilTest, HighestMinFetchTimestampSucceeds) {
std::vector<DonorShardEntry> donorShards{
makeDonorShard(ShardId("s0"), DonorStateEnum::kDonatingInitialData, Timestamp(10, 2)),
makeDonorShard(ShardId("s1"), DonorStateEnum::kDonatingInitialData, Timestamp(10, 3)),
makeDonorShard(ShardId("s2"), DonorStateEnum::kDonatingInitialData, Timestamp(10, 1))};
auto highestMinFetchTimestamp = getHighestMinFetchTimestamp(donorShards);
Reported by Cppcheck.
src/mongo/db/s/resharding_collection_test.cpp
1 issues
Line: 81
using ReshardingCollectionTest = ShardServerTestFixture;
TEST_F(ReshardingCollectionTest, TestWritesToTempReshardingCollection) {
SimpleClient client(operationContext());
auto uuid = UUID::gen();
auto tempNss = NamespaceString{"{}.system.resharding.{}"_format("test", uuid.toString())};
ASSERT_OK(client.insert(tempNss, BSON("x" << 5)));
Reported by Cppcheck.