summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2021-07-29 15:28:20 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-08-02 23:52:53 +0000
commit27f328ad14b8fbc006c5c4103becd0f6a3aaaa5c (patch)
treedf483a3165f012efe9c395e4bae67aa8097fe1ab /src/mongo/db/repl
parenteae9041c1c1320a15a6b13f3f1d4770a2b96e085 (diff)
downloadmongo-27f328ad14b8fbc006c5c4103becd0f6a3aaaa5c.tar.gz
SERVER-57446 fix clang-tidy header issues and add header-filter
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r--src/mongo/db/repl/check_quorum_for_config_change.h4
-rw-r--r--src/mongo/db/repl/collection_bulk_loader.h4
-rw-r--r--src/mongo/db/repl/collection_bulk_loader_impl.h12
-rw-r--r--src/mongo/db/repl/hello_response.h5
-rw-r--r--src/mongo/db/repl/isself.h2
-rw-r--r--src/mongo/db/repl/oplog.h2
-rw-r--r--src/mongo/db/repl/oplog_applier_impl.h4
-rw-r--r--src/mongo/db/repl/oplog_applier_impl_test_fixture.h2
-rw-r--r--src/mongo/db/repl/oplog_entry.h8
-rw-r--r--src/mongo/db/repl/oplog_fetcher.h3
-rw-r--r--src/mongo/db/repl/replication_coordinator.h6
-rw-r--r--src/mongo/db/repl/replication_coordinator_impl.h8
-rw-r--r--src/mongo/db/repl/replication_coordinator_mock.h6
-rw-r--r--src/mongo/db/repl/replication_coordinator_noop.h6
-rw-r--r--src/mongo/db/repl/replication_metrics.h34
-rw-r--r--src/mongo/db/repl/scatter_gather_runner.h2
-rw-r--r--src/mongo/db/repl/storage_interface.h4
-rw-r--r--src/mongo/db/repl/storage_interface_impl.h4
-rw-r--r--src/mongo/db/repl/storage_interface_mock.h4
-rw-r--r--src/mongo/db/repl/tenant_migration_access_blocker_util.h4
-rw-r--r--src/mongo/db/repl/tenant_migration_donor_service.h4
-rw-r--r--src/mongo/db/repl/tenant_migration_recipient_service.h8
-rw-r--r--src/mongo/db/repl/tenant_oplog_applier.h2
-rw-r--r--src/mongo/db/repl/tenant_oplog_batcher.h2
-rw-r--r--src/mongo/db/repl/topology_coordinator.h19
-rw-r--r--src/mongo/db/repl/transaction_oplog_application.h2
26 files changed, 79 insertions, 82 deletions
diff --git a/src/mongo/db/repl/check_quorum_for_config_change.h b/src/mongo/db/repl/check_quorum_for_config_change.h
index 4a7cbcb219f..446dd89e03d 100644
--- a/src/mongo/db/repl/check_quorum_for_config_change.h
+++ b/src/mongo/db/repl/check_quorum_for_config_change.h
@@ -134,7 +134,7 @@ private:
*/
Status checkQuorumForInitiate(executor::TaskExecutor* executor,
const ReplSetConfig& rsConfig,
- const int myIndex,
+ int myIndex,
long long term);
/**
@@ -154,7 +154,7 @@ Status checkQuorumForInitiate(executor::TaskExecutor* executor,
*/
Status checkQuorumForReconfig(executor::TaskExecutor* executor,
const ReplSetConfig& rsConfig,
- const int myIndex,
+ int myIndex,
long long term);
} // namespace repl
diff --git a/src/mongo/db/repl/collection_bulk_loader.h b/src/mongo/db/repl/collection_bulk_loader.h
index 7fc018f6a6a..261fc3e9bfd 100644
--- a/src/mongo/db/repl/collection_bulk_loader.h
+++ b/src/mongo/db/repl/collection_bulk_loader.h
@@ -58,8 +58,8 @@ public:
* Inserts the documents into the collection record store, and indexes them with the
* MultiIndexBlock on the side.
*/
- virtual Status insertDocuments(const std::vector<BSONObj>::const_iterator begin,
- const std::vector<BSONObj>::const_iterator end) = 0;
+ virtual Status insertDocuments(std::vector<BSONObj>::const_iterator begin,
+ std::vector<BSONObj>::const_iterator end) = 0;
/**
* Called when inserts are done and indexes can be committed.
*/
diff --git a/src/mongo/db/repl/collection_bulk_loader_impl.h b/src/mongo/db/repl/collection_bulk_loader_impl.h
index fab8ed9c922..d7077376478 100644
--- a/src/mongo/db/repl/collection_bulk_loader_impl.h
+++ b/src/mongo/db/repl/collection_bulk_loader_impl.h
@@ -68,8 +68,8 @@ public:
virtual Status init(const std::vector<BSONObj>& secondaryIndexSpecs) override;
- virtual Status insertDocuments(const std::vector<BSONObj>::const_iterator begin,
- const std::vector<BSONObj>::const_iterator end) override;
+ virtual Status insertDocuments(std::vector<BSONObj>::const_iterator begin,
+ std::vector<BSONObj>::const_iterator end) override;
virtual Status commit() override;
CollectionBulkLoaderImpl::Stats getStats() const;
@@ -86,16 +86,16 @@ private:
/**
* For capped collections, each document will be inserted in its own WriteUnitOfWork.
*/
- Status _insertDocumentsForCappedCollection(const std::vector<BSONObj>::const_iterator begin,
- const std::vector<BSONObj>::const_iterator end);
+ Status _insertDocumentsForCappedCollection(std::vector<BSONObj>::const_iterator begin,
+ std::vector<BSONObj>::const_iterator end);
/**
* For uncapped collections, we will insert documents in batches of size
* collectionBulkLoaderBatchSizeInBytes or up to one document size greater. All insertions in a
* given batch will be inserted in one WriteUnitOfWork.
*/
- Status _insertDocumentsForUncappedCollection(const std::vector<BSONObj>::const_iterator begin,
- const std::vector<BSONObj>::const_iterator end);
+ Status _insertDocumentsForUncappedCollection(std::vector<BSONObj>::const_iterator begin,
+ std::vector<BSONObj>::const_iterator end);
/**
* Adds document and associated RecordId to index blocks after inserting into RecordStore.
diff --git a/src/mongo/db/repl/hello_response.h b/src/mongo/db/repl/hello_response.h
index 82fc3c00339..489f97e4d2d 100644
--- a/src/mongo/db/repl/hello_response.h
+++ b/src/mongo/db/repl/hello_response.h
@@ -234,10 +234,9 @@ public:
void setElectionId(const OID& electionId);
- void setLastWrite(const OpTime& lastWriteOpTime, const time_t lastWriteDate);
+ void setLastWrite(const OpTime& lastWriteOpTime, time_t lastWriteDate);
- void setLastMajorityWrite(const OpTime& lastMajorityWriteOpTime,
- const time_t lastMajorityWriteDate);
+ void setLastMajorityWrite(const OpTime& lastMajorityWriteOpTime, time_t lastMajorityWriteDate);
/**
* Marks _configSet as false, which will cause future calls to toBSON/addToBSON to ignore
diff --git a/src/mongo/db/repl/isself.h b/src/mongo/db/repl/isself.h
index 6358f53037d..84264978720 100644
--- a/src/mongo/db/repl/isself.h
+++ b/src/mongo/db/repl/isself.h
@@ -59,7 +59,7 @@ bool isSelf(const HostAndPort& hostAndPort, ServiceContext* ctx);
* Note: this only works on Linux and Windows. All calls should be properly ifdef'd,
* otherwise an invariant will be triggered.
*/
-std::vector<std::string> getBoundAddrs(const bool ipv6enabled);
+std::vector<std::string> getBoundAddrs(bool ipv6enabled);
} // namespace repl
} // namespace mongo
diff --git a/src/mongo/db/repl/oplog.h b/src/mongo/db/repl/oplog.h
index e975ee42095..c3c9c2de13a 100644
--- a/src/mongo/db/repl/oplog.h
+++ b/src/mongo/db/repl/oplog.h
@@ -215,7 +215,7 @@ Status applyOperation_inlock(OperationContext* opCtx,
const OplogEntryOrGroupedInserts& opOrGroupedInserts,
bool alwaysUpsert,
OplogApplication::Mode mode,
- const bool isDataConsistent,
+ bool isDataConsistent,
IncrementOpsAppliedStatsFn incrementOpsAppliedStats = {});
/**
diff --git a/src/mongo/db/repl/oplog_applier_impl.h b/src/mongo/db/repl/oplog_applier_impl.h
index 574965802fc..b93756d9456 100644
--- a/src/mongo/db/repl/oplog_applier_impl.h
+++ b/src/mongo/db/repl/oplog_applier_impl.h
@@ -141,7 +141,7 @@ protected:
virtual Status applyOplogBatchPerWorker(OperationContext* opCtx,
std::vector<const OplogEntry*>* ops,
WorkerMultikeyPathInfo* workerMultikeyPathInfo,
- const bool isDataConsistent);
+ bool isDataConsistent);
};
/**
@@ -150,7 +150,7 @@ protected:
Status applyOplogEntryOrGroupedInserts(OperationContext* opCtx,
const OplogEntryOrGroupedInserts& entryOrGroupedInserts,
OplogApplication::Mode oplogApplicationMode,
- const bool isDataConsistent);
+ bool isDataConsistent);
} // namespace repl
} // namespace mongo
diff --git a/src/mongo/db/repl/oplog_applier_impl_test_fixture.h b/src/mongo/db/repl/oplog_applier_impl_test_fixture.h
index 9e142904876..7cc2cc81e1d 100644
--- a/src/mongo/db/repl/oplog_applier_impl_test_fixture.h
+++ b/src/mongo/db/repl/oplog_applier_impl_test_fixture.h
@@ -308,7 +308,7 @@ bool collectionExists(OperationContext* opCtx, const NamespaceString& nss);
*/
void createIndex(OperationContext* opCtx,
const NamespaceString& nss,
- const UUID collUUID,
+ UUID collUUID,
const BSONObj& spec);
} // namespace repl
diff --git a/src/mongo/db/repl/oplog_entry.h b/src/mongo/db/repl/oplog_entry.h
index 7c39c7618c2..021261c64d6 100644
--- a/src/mongo/db/repl/oplog_entry.h
+++ b/src/mongo/db/repl/oplog_entry.h
@@ -93,7 +93,7 @@ public:
static ReplOperation makeInsertOperation(const NamespaceString& nss,
UUID uuid,
const BSONObj& docToInsert);
- static ReplOperation makeUpdateOperation(const NamespaceString nss,
+ static ReplOperation makeUpdateOperation(NamespaceString nss,
UUID uuid,
const BSONObj& update,
const BSONObj& criteria);
@@ -101,11 +101,11 @@ public:
UUID uuid,
const BSONObj& docToDelete);
- static ReplOperation makeCreateCommand(const NamespaceString nss,
+ static ReplOperation makeCreateCommand(NamespaceString nss,
const mongo::CollectionOptions& options,
const BSONObj& idIndex);
- static ReplOperation makeCreateIndexesCommand(const NamespaceString nss,
+ static ReplOperation makeCreateIndexesCommand(NamespaceString nss,
CollectionUUID uuid,
const BSONObj& indexDoc);
@@ -305,7 +305,7 @@ public:
static StatusWith<DurableOplogEntry> parse(const BSONObj& object);
DurableOplogEntry(OpTime opTime,
- const boost::optional<int64_t> hash,
+ boost::optional<int64_t> hash,
OpTypeEnum opType,
const NamespaceString& nss,
const boost::optional<UUID>& uuid,
diff --git a/src/mongo/db/repl/oplog_fetcher.h b/src/mongo/db/repl/oplog_fetcher.h
index 808495d9623..9e2c5a2f71a 100644
--- a/src/mongo/db/repl/oplog_fetcher.h
+++ b/src/mongo/db/repl/oplog_fetcher.h
@@ -434,8 +434,7 @@ private:
* This will be called when we check the first batch of results and our last fetched optime does
* not equal the first document in that batch. This function should never return Status::OK().
*/
- Status _checkTooStaleToSyncFromSource(const OpTime lastFetched,
- const OpTime firstOpTimeInDocument);
+ Status _checkTooStaleToSyncFromSource(OpTime lastFetched, OpTime firstOpTimeInDocument);
// Protects member data of this OplogFetcher.
mutable Mutex _mutex = MONGO_MAKE_LATCH("OplogFetcher::_mutex");
diff --git a/src/mongo/db/repl/replication_coordinator.h b/src/mongo/db/repl/replication_coordinator.h
index fcb9d2a44d0..ff5c96ba861 100644
--- a/src/mongo/db/repl/replication_coordinator.h
+++ b/src/mongo/db/repl/replication_coordinator.h
@@ -1065,9 +1065,9 @@ public:
* internal operations occurs (i.e. step up, step down, or rollback). Also logs the metrics.
*/
virtual void updateAndLogStateTransitionMetrics(
- const ReplicationCoordinator::OpsKillingStateTransitionEnum stateTransition,
- const size_t numOpsKilled,
- const size_t numOpsRunning) const = 0;
+ ReplicationCoordinator::OpsKillingStateTransitionEnum stateTransition,
+ size_t numOpsKilled,
+ size_t numOpsRunning) const = 0;
/**
* Increment the server TopologyVersion and fulfill the promise of any currently waiting
diff --git a/src/mongo/db/repl/replication_coordinator_impl.h b/src/mongo/db/repl/replication_coordinator_impl.h
index 5c7ec29b3dd..a017021ba03 100644
--- a/src/mongo/db/repl/replication_coordinator_impl.h
+++ b/src/mongo/db/repl/replication_coordinator_impl.h
@@ -380,9 +380,9 @@ public:
virtual void finishRecoveryIfEligible(OperationContext* opCtx) override;
virtual void updateAndLogStateTransitionMetrics(
- const ReplicationCoordinator::OpsKillingStateTransitionEnum stateTransition,
- const size_t numOpsKilled,
- const size_t numOpsRunning) const override;
+ ReplicationCoordinator::OpsKillingStateTransitionEnum stateTransition,
+ size_t numOpsKilled,
+ size_t numOpsRunning) const override;
virtual TopologyVersion getTopologyVersion() const override;
@@ -1265,7 +1265,7 @@ private:
*/
std::shared_ptr<HelloResponse> _makeHelloResponse(boost::optional<StringData> horizonString,
WithLock,
- const bool hasValidConfig) const;
+ bool hasValidConfig) const;
/**
* Creates a semi-future for HelloResponse. horizonString should be passed in if and only if
diff --git a/src/mongo/db/repl/replication_coordinator_mock.h b/src/mongo/db/repl/replication_coordinator_mock.h
index 74cf6bad540..7d6afaddb35 100644
--- a/src/mongo/db/repl/replication_coordinator_mock.h
+++ b/src/mongo/db/repl/replication_coordinator_mock.h
@@ -360,9 +360,9 @@ public:
virtual void finishRecoveryIfEligible(OperationContext* opCtx) override;
virtual void updateAndLogStateTransitionMetrics(
- const ReplicationCoordinator::OpsKillingStateTransitionEnum stateTransition,
- const size_t numOpsKilled,
- const size_t numOpsRunning) const override;
+ ReplicationCoordinator::OpsKillingStateTransitionEnum stateTransition,
+ size_t numOpsKilled,
+ size_t numOpsRunning) const override;
virtual void setCanAcceptNonLocalWrites(bool canAcceptNonLocalWrites);
diff --git a/src/mongo/db/repl/replication_coordinator_noop.h b/src/mongo/db/repl/replication_coordinator_noop.h
index 85ca9de0a2a..33f51c6094a 100644
--- a/src/mongo/db/repl/replication_coordinator_noop.h
+++ b/src/mongo/db/repl/replication_coordinator_noop.h
@@ -297,9 +297,9 @@ public:
void incrementTopologyVersion() final;
void updateAndLogStateTransitionMetrics(
- const ReplicationCoordinator::OpsKillingStateTransitionEnum stateTransition,
- const size_t numOpsKilled,
- const size_t numOpsRunning) const final;
+ ReplicationCoordinator::OpsKillingStateTransitionEnum stateTransition,
+ size_t numOpsKilled,
+ size_t numOpsRunning) const final;
TopologyVersion getTopologyVersion() const final;
diff --git a/src/mongo/db/repl/replication_metrics.h b/src/mongo/db/repl/replication_metrics.h
index 108510bbcd8..6eef7fc5268 100644
--- a/src/mongo/db/repl/replication_metrics.h
+++ b/src/mongo/db/repl/replication_metrics.h
@@ -81,15 +81,15 @@ public:
// All the election candidate metrics that should be set when a node calls an election are set
// in this one function, so that the 'electionCandidateMetrics' section of replSetStatus shows a
// consistent state.
- void setElectionCandidateMetrics(const StartElectionReasonEnum reason,
- const Date_t lastElectionDate,
- const long long electionTerm,
- const OpTime lastCommittedOpTime,
- const OpTime lastSeenOpTime,
- const int numVotesNeeded,
- const double priorityAtElection,
- const Milliseconds electionTimeoutMillis,
- const boost::optional<int> priorPrimary);
+ void setElectionCandidateMetrics(StartElectionReasonEnum reason,
+ Date_t lastElectionDate,
+ long long electionTerm,
+ OpTime lastCommittedOpTime,
+ OpTime lastSeenOpTime,
+ int numVotesNeeded,
+ double priorityAtElection,
+ Milliseconds electionTimeoutMillis,
+ boost::optional<int> priorPrimary);
void setTargetCatchupOpTime(OpTime opTime);
void setNumCatchUpOps(long numCatchUpOps);
void setCandidateNewTermStartDate(Date_t newTermStartDate);
@@ -106,14 +106,14 @@ public:
// All the election participant metrics that should be set when a node votes in an election are
// set in this one function, so that the 'electionParticipantMetrics' section of replSetStatus
// shows a consistent state.
- void setElectionParticipantMetrics(const bool votedForCandidate,
- const long long electionTerm,
- const Date_t lastVoteDate,
- const int electionCandidateMemberId,
- const std::string voteReason,
- const OpTime lastAppliedOpTime,
- const OpTime maxAppliedOpTimeInSet,
- const double priorityAtElection);
+ void setElectionParticipantMetrics(bool votedForCandidate,
+ long long electionTerm,
+ Date_t lastVoteDate,
+ int electionCandidateMemberId,
+ std::string voteReason,
+ OpTime lastAppliedOpTime,
+ OpTime maxAppliedOpTimeInSet,
+ double priorityAtElection);
BSONObj getElectionParticipantMetricsBSON();
void setParticipantNewTermDates(Date_t newTermStartDate, Date_t newTermAppliedDate);
diff --git a/src/mongo/db/repl/scatter_gather_runner.h b/src/mongo/db/repl/scatter_gather_runner.h
index 90f20bc20b5..610d21a675d 100644
--- a/src/mongo/db/repl/scatter_gather_runner.h
+++ b/src/mongo/db/repl/scatter_gather_runner.h
@@ -109,7 +109,7 @@ private:
* The returned event will eventually be signaled.
*/
StatusWith<executor::TaskExecutor::EventHandle> start(
- const executor::TaskExecutor::RemoteCommandCallbackFn cb);
+ executor::TaskExecutor::RemoteCommandCallbackFn cb);
/**
* Informs the runner to cancel further processing.
diff --git a/src/mongo/db/repl/storage_interface.h b/src/mongo/db/repl/storage_interface.h
index a4e5442c0b2..027b14af6df 100644
--- a/src/mongo/db/repl/storage_interface.h
+++ b/src/mongo/db/repl/storage_interface.h
@@ -117,7 +117,7 @@ public:
virtual StatusWith<std::unique_ptr<CollectionBulkLoader>> createCollectionForBulkLoading(
const NamespaceString& nss,
const CollectionOptions& options,
- const BSONObj idIndexSpec,
+ BSONObj idIndexSpec,
const std::vector<BSONObj>& secondaryIndexSpecs) = 0;
/**
@@ -170,7 +170,7 @@ public:
virtual Status createCollection(OperationContext* opCtx,
const NamespaceString& nss,
const CollectionOptions& options,
- const bool createIdIndex = true,
+ bool createIdIndex = true,
const BSONObj& idIndexSpec = BSONObj()) = 0;
/**
diff --git a/src/mongo/db/repl/storage_interface_impl.h b/src/mongo/db/repl/storage_interface_impl.h
index 5c935d1bbc5..f99b3a0c094 100644
--- a/src/mongo/db/repl/storage_interface_impl.h
+++ b/src/mongo/db/repl/storage_interface_impl.h
@@ -62,7 +62,7 @@ public:
StatusWith<std::unique_ptr<CollectionBulkLoader>> createCollectionForBulkLoading(
const NamespaceString& nss,
const CollectionOptions& options,
- const BSONObj idIndexSpec,
+ BSONObj idIndexSpec,
const std::vector<BSONObj>& secondaryIndexSpecs) override;
Status insertDocument(OperationContext* opCtx,
@@ -82,7 +82,7 @@ public:
Status createCollection(OperationContext* opCtx,
const NamespaceString& nss,
const CollectionOptions& options,
- const bool createIdIndex = true,
+ bool createIdIndex = true,
const BSONObj& idIndexSpec = BSONObj()) override;
Status createIndexesOnEmptyCollection(OperationContext* opCtx,
diff --git a/src/mongo/db/repl/storage_interface_mock.h b/src/mongo/db/repl/storage_interface_mock.h
index 0b35fe833e3..03416512bb9 100644
--- a/src/mongo/db/repl/storage_interface_mock.h
+++ b/src/mongo/db/repl/storage_interface_mock.h
@@ -64,8 +64,8 @@ public:
virtual ~CollectionBulkLoaderMock() = default;
Status init(const std::vector<BSONObj>& secondaryIndexSpecs) override;
- Status insertDocuments(const std::vector<BSONObj>::const_iterator begin,
- const std::vector<BSONObj>::const_iterator end) override;
+ Status insertDocuments(std::vector<BSONObj>::const_iterator begin,
+ std::vector<BSONObj>::const_iterator end) override;
Status commit() override;
std::string toString() const override {
diff --git a/src/mongo/db/repl/tenant_migration_access_blocker_util.h b/src/mongo/db/repl/tenant_migration_access_blocker_util.h
index 8c4f66a4837..f5d9a36b89e 100644
--- a/src/mongo/db/repl/tenant_migration_access_blocker_util.h
+++ b/src/mongo/db/repl/tenant_migration_access_blocker_util.h
@@ -41,10 +41,10 @@ namespace mongo {
namespace tenant_migration_access_blocker {
std::shared_ptr<TenantMigrationDonorAccessBlocker> getTenantMigrationDonorAccessBlocker(
- ServiceContext* const serviceContext, StringData tenantId);
+ ServiceContext* serviceContext, StringData tenantId);
std::shared_ptr<TenantMigrationRecipientAccessBlocker> getTenantMigrationRecipientAccessBlocker(
- ServiceContext* const serviceContext, StringData tenantId);
+ ServiceContext* serviceContext, StringData tenantId);
/**
* Returns a TenantMigrationDonorDocument constructed from the given bson doc and validate the
diff --git a/src/mongo/db/repl/tenant_migration_donor_service.h b/src/mongo/db/repl/tenant_migration_donor_service.h
index 799f02af7f8..eb61d5ade1b 100644
--- a/src/mongo/db/repl/tenant_migration_donor_service.h
+++ b/src/mongo/db/repl/tenant_migration_donor_service.h
@@ -80,7 +80,7 @@ public:
boost::optional<Status> abortReason;
};
- explicit Instance(ServiceContext* const serviceContext,
+ explicit Instance(ServiceContext* serviceContext,
const TenantMigrationDonorService* donorService,
const BSONObj& initialState);
@@ -208,7 +208,7 @@ public:
*/
ExecutorFuture<repl::OpTime> _updateStateDoc(
std::shared_ptr<executor::ScopedTaskExecutor> executor,
- const TenantMigrationDonorStateEnum nextState,
+ TenantMigrationDonorStateEnum nextState,
const CancellationToken& token);
/**
diff --git a/src/mongo/db/repl/tenant_migration_recipient_service.h b/src/mongo/db/repl/tenant_migration_recipient_service.h
index 5c9f375b59f..3ada46582fb 100644
--- a/src/mongo/db/repl/tenant_migration_recipient_service.h
+++ b/src/mongo/db/repl/tenant_migration_recipient_service.h
@@ -64,7 +64,7 @@ public:
"TenantMigrationRecipientService"_sd;
static constexpr StringData kNoopMsg = "Resume token noop"_sd;
- explicit TenantMigrationRecipientService(ServiceContext* const serviceContext);
+ explicit TenantMigrationRecipientService(ServiceContext* serviceContext);
~TenantMigrationRecipientService() = default;
StringData getServiceName() const final;
@@ -82,7 +82,7 @@ public:
class Instance final : public PrimaryOnlyService::TypedInstance<Instance> {
public:
- explicit Instance(ServiceContext* const serviceContext,
+ explicit Instance(ServiceContext* serviceContext,
const TenantMigrationRecipientService* recipientService,
BSONObj stateDoc);
@@ -419,8 +419,8 @@ public:
* should resume from. The oplog applier should resume applying entries that have a greater
* optime than the returned value.
*/
- OpTime _getOplogResumeApplyingDonorOptime(const OpTime startApplyingDonorOpTime,
- const OpTime cloneFinishedRecipientOpTime) const;
+ OpTime _getOplogResumeApplyingDonorOptime(OpTime startApplyingDonorOpTime,
+ OpTime cloneFinishedRecipientOpTime) const;
/*
* Starts the tenant cloner.
diff --git a/src/mongo/db/repl/tenant_oplog_applier.h b/src/mongo/db/repl/tenant_oplog_applier.h
index 9953150b657..58c4533b0d6 100644
--- a/src/mongo/db/repl/tenant_oplog_applier.h
+++ b/src/mongo/db/repl/tenant_oplog_applier.h
@@ -134,7 +134,7 @@ private:
Status _applyOplogEntryOrGroupedInserts(OperationContext* opCtx,
const OplogEntryOrGroupedInserts& entryOrGroupedInserts,
OplogApplication::Mode oplogApplicationMode,
- const bool isDataConsistent);
+ bool isDataConsistent);
std::vector<std::vector<const OplogEntry*>> _fillWriterVectors(OperationContext* opCtx,
TenantOplogBatch* batch);
diff --git a/src/mongo/db/repl/tenant_oplog_batcher.h b/src/mongo/db/repl/tenant_oplog_batcher.h
index 7349969aa7c..a2c266061c5 100644
--- a/src/mongo/db/repl/tenant_oplog_batcher.h
+++ b/src/mongo/db/repl/tenant_oplog_batcher.h
@@ -76,7 +76,7 @@ public:
TenantOplogBatcher(const std::string& tenantId,
RandomAccessOplogBuffer* oplogBuffer,
std::shared_ptr<executor::TaskExecutor> executor,
- const Timestamp resumeBatchingTs);
+ Timestamp resumeBatchingTs);
virtual ~TenantOplogBatcher();
diff --git a/src/mongo/db/repl/topology_coordinator.h b/src/mongo/db/repl/topology_coordinator.h
index 91ee17012c2..3f61c836c56 100644
--- a/src/mongo/db/repl/topology_coordinator.h
+++ b/src/mongo/db/repl/topology_coordinator.h
@@ -279,7 +279,7 @@ public:
const MemberState& memberState,
const OpTime& previousOpTimeFetched,
Date_t now,
- const ReadPreference readPreference);
+ ReadPreference readPreference);
/**
* Sets the reported mode of this node to one of RS_SECONDARY, RS_STARTUP2, RS_ROLLBACK or
@@ -512,7 +512,7 @@ public:
* Marks a member as down from our perspective and returns a bool which indicates if we can no
* longer see a majority of the nodes and thus should step down.
*/
- bool setMemberAsDown(Date_t now, const int memberIndex);
+ bool setMemberAsDown(Date_t now, int memberIndex);
/**
* Goes through the memberData and determines which member that is currently live
@@ -703,7 +703,7 @@ public:
/**
* Set the outgoing heartbeat message from self
*/
- void setMyHeartbeatMessage(const Date_t now, const std::string& s);
+ void setMyHeartbeatMessage(Date_t now, const std::string& s);
/**
* Prepares a ReplSetMetadata object describing the current term, primary, and lastOp
@@ -743,7 +743,7 @@ public:
/**
* Transitions to the candidate role if the node is electable.
*/
- Status becomeCandidateIfElectable(const Date_t now, StartElectionReasonEnum reason);
+ Status becomeCandidateIfElectable(Date_t now, StartElectionReasonEnum reason);
/**
* Updates the storage engine read committed support in the TopologyCoordinator options after
@@ -754,7 +754,7 @@ public:
/**
* Reset the booleans to record the last heartbeat restart for the target node.
*/
- void restartHeartbeat(const Date_t now, const HostAndPort& target);
+ void restartHeartbeat(Date_t now, const HostAndPort& target);
/**
* Increments the counter field of the current TopologyVersion.
@@ -828,7 +828,7 @@ public:
/**
* Records the ping for the given host. For use only in testing.
*/
- void setPing_forTest(const HostAndPort& host, const Milliseconds ping);
+ void setPing_forTest(const HostAndPort& host, Milliseconds ping);
// Returns _electionTime. Only used in unittests.
Timestamp getElectionTime() const;
@@ -946,7 +946,7 @@ private:
// Checks if the node can see a healthy primary of equal or greater priority to the
// candidate. If so, returns the index of that node. Otherwise returns -1.
- int _findHealthyPrimaryOfEqualOrGreaterPriority(const int candidateIndex) const;
+ int _findHealthyPrimaryOfEqualOrGreaterPriority(int candidateIndex) const;
// Is our optime close enough to the latest known optime to call for a priority takeover.
bool _amIFreshEnoughForPriorityTakeover() const;
@@ -956,8 +956,7 @@ private:
bool _amIFreshEnoughForCatchupTakeover() const;
// Returns reason why "self" member is unelectable
- UnelectableReasonMask _getMyUnelectableReason(const Date_t now,
- StartElectionReasonEnum reason) const;
+ UnelectableReasonMask _getMyUnelectableReason(Date_t now, StartElectionReasonEnum reason) const;
// Returns reason why memberIndex is unelectable
UnelectableReasonMask _getUnelectableReason(int memberIndex) const;
@@ -984,7 +983,7 @@ private:
* Returns information we have on the state of the node identified by memberId. Returns
* nullptr if memberId is not found in the configuration.
*/
- MemberData* _findMemberDataByMemberId(const int memberId);
+ MemberData* _findMemberDataByMemberId(int memberId);
/**
* Performs updating "_currentPrimaryIndex" for processHeartbeatResponse().
diff --git a/src/mongo/db/repl/transaction_oplog_application.h b/src/mongo/db/repl/transaction_oplog_application.h
index 6b108447b00..57f554acafe 100644
--- a/src/mongo/db/repl/transaction_oplog_application.h
+++ b/src/mongo/db/repl/transaction_oplog_application.h
@@ -79,7 +79,7 @@ std::pair<std::vector<repl::OplogEntry>, bool> _readTransactionOperationsFromOpl
OperationContext* opCtx,
const repl::OplogEntry& lastEntryInTxn,
const std::vector<repl::OplogEntry*>& cachedOps,
- const bool checkForCommands) noexcept;
+ bool checkForCommands) noexcept;
/**
* Apply `prepareTransaction` oplog entry.