diff options
author | Misha Tyulenev <misha@mongodb.com> | 2017-07-11 12:46:24 -0400 |
---|---|---|
committer | Misha Tyulenev <misha@mongodb.com> | 2017-07-11 12:47:24 -0400 |
commit | 42a1339774964f645a3991c3629aa655ffb05cf2 (patch) | |
tree | 219ff15c39190d2aa734ea0cafb4b25d41b4e648 /src/mongo/db | |
parent | 2ed5ff7d34959ebe204697ff615d24a8eabc45bf (diff) | |
download | mongo-42a1339774964f645a3991c3629aa655ffb05cf2.tar.gz |
SERVER-30038 rename $logicalTime to $clusterTime
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/commands.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/commands.h | 2 | ||||
-rw-r--r-- | src/mongo/db/keys_collection_cache_reader_and_updater.h | 2 | ||||
-rw-r--r-- | src/mongo/db/logical_clock.h | 2 | ||||
-rw-r--r-- | src/mongo/db/logical_clock_test.cpp | 12 | ||||
-rw-r--r-- | src/mongo/db/logical_time_metadata_hook.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/logical_time_validator.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/logical_time_validator.h | 6 | ||||
-rw-r--r-- | src/mongo/db/repl/read_concern_args.h | 2 | ||||
-rw-r--r-- | src/mongo/db/service_entry_point_mongod.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/time_proof_service.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/time_proof_service.h | 2 | ||||
-rw-r--r-- | src/mongo/db/time_proof_service_test.cpp | 4 |
13 files changed, 25 insertions, 25 deletions
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp index ce98a97f97f..b431751dc9f 100644 --- a/src/mongo/db/commands.cpp +++ b/src/mongo/db/commands.cpp @@ -379,7 +379,7 @@ void Command::filterCommandReplyForPassthrough(const BSONObj& cmdObj, BSONObjBui const auto name = elem.fieldNameStringData(); if (name == "$configServerState" || // name == "$gleStats" || // - name == "$logicalTime" || // + name == "$clusterTime" || // name == "$oplogQueryData" || // name == "$replData" || // name == "operationTime") { diff --git a/src/mongo/db/commands.h b/src/mongo/db/commands.h index 13db6740e6b..1efd437d3ef 100644 --- a/src/mongo/db/commands.h +++ b/src/mongo/db/commands.h @@ -510,7 +510,7 @@ public: arg == "$queryOptions" || // arg == "$readPreference" || // arg == "$replData" || // - arg == "$logicalTime" || // + arg == "$clusterTime" || // arg == "maxTimeMS" || // arg == "readConcern" || // arg == "shardVersion" || // diff --git a/src/mongo/db/keys_collection_cache_reader_and_updater.h b/src/mongo/db/keys_collection_cache_reader_and_updater.h index 590d88f6cdb..4719f58c48b 100644 --- a/src/mongo/db/keys_collection_cache_reader_and_updater.h +++ b/src/mongo/db/keys_collection_cache_reader_and_updater.h @@ -39,7 +39,7 @@ class ShardingCatalogClient; /** * Keeps a local cache of the keys with the ability to refresh. The refresh method also makes sure - * that there will be valid keys available to sign the current logical time and there will be + * that there will be valid keys available to sign the current cluster time and there will be * another key ready after the current key expires. * * Assumptions and limitations: diff --git a/src/mongo/db/logical_clock.h b/src/mongo/db/logical_clock.h index a1be25c3265..2408e03439b 100644 --- a/src/mongo/db/logical_clock.h +++ b/src/mongo/db/logical_clock.h @@ -84,7 +84,7 @@ public: private: /** - * Rate limiter for advancing logical time. Rejects newTime if its seconds value is more than + * Rate limiter for advancing cluster time. Rejects newTime if its seconds value is more than * kMaxAcceptableLogicalClockDriftSecs seconds ahead of this node's wall clock. */ Status _passesRateLimiter_inlock(LogicalTime newTime); diff --git a/src/mongo/db/logical_clock_test.cpp b/src/mongo/db/logical_clock_test.cpp index 27c1f1a0907..bf3b78a3062 100644 --- a/src/mongo/db/logical_clock_test.cpp +++ b/src/mongo/db/logical_clock_test.cpp @@ -103,7 +103,7 @@ TEST_F(LogicalClockTest, advanceClusterTime) { ASSERT_TRUE(t1 == getClock()->getClusterTime()); } -// Verify rate limiter rejects logical times whose seconds values are too far ahead. +// Verify rate limiter rejects cluster times whose seconds values are too far ahead. TEST_F(LogicalClockTest, RateLimiterRejectsLogicalTimesTooFarAhead) { setMockClockSourceTime(Date_t::fromMillisSinceEpoch(10 * 1000)); @@ -148,7 +148,7 @@ TEST_F(LogicalClockTest, WritesToOplogAdvanceClusterTime) { // Tests the scenario where an admin incorrectly sets the wall clock more than // maxAcceptableLogicalClockDriftSecs in the past at startup, and cluster time is initialized to // the incorrect past time, then the admin resets the clock to the current time. In this case, -// logical time can be advanced through metadata as long as the new time isn't +// cluster time can be advanced through metadata as long as the new time isn't // maxAcceptableLogicalClockDriftSecs ahead of the correct current wall clock time, since the rate // limiter compares new times to the wall clock, not the cluster time. TEST_F(LogicalClockTest, WallClockSetTooFarInPast) { @@ -180,7 +180,7 @@ TEST_F(LogicalClockTest, WallClockSetTooFarInPast) { // Tests the scenario where an admin incorrectly sets the wall clock more than // maxAcceptableLogicalClockDriftSecs in the future and a write is accepted, advancing cluster -// time, then the admin resets the clock to the current time. In this case, logical time cannot be +// time, then the admin resets the clock to the current time. In this case, cluster time cannot be // advanced through metadata unless the drift parameter is increased. TEST_F(LogicalClockTest, WallClockSetTooFarInFuture) { auto oneDay = Seconds(24 * 60 * 60); @@ -206,7 +206,7 @@ TEST_F(LogicalClockTest, WallClockSetTooFarInFuture) { // Verify that maxAcceptableLogicalClockDriftSecs parameter has to be increased to advance // cluster time through metadata. auto nextTime = getClock()->getClusterTime(); - nextTime.addTicks(1); // The next lowest logical time. + nextTime.addTicks(1); // The next lowest cluster time. ASSERT_EQ(ErrorCodes::ClusterTimeFailsRateLimiter, getClock()->advanceClusterTime(nextTime)); @@ -308,11 +308,11 @@ TEST_F(LogicalClockTest, ReserveTicksBehaviorWhenWallClockNearMaxTime) { ASSERT_TRUE(getClock()->getClusterTime() == buildLogicalTime(1, 1)); } -// Verify the clock rejects logical times greater than the max allowed time. +// Verify the clock rejects cluster times greater than the max allowed time. TEST_F(LogicalClockTest, RejectsLogicalTimesGreaterThanMaxTime) { unsigned maxVal = LogicalClock::kMaxSignedInt; - // A logical time can be greater than the maximum value allowed because the signed integer + // A cluster time can be greater than the maximum value allowed because the signed integer // maximum is used for legacy compatibility, but these fields are stored as unsigned integers. auto beyondMaxTime = buildLogicalTime(maxVal + 1, maxVal + 1); diff --git a/src/mongo/db/logical_time_metadata_hook.cpp b/src/mongo/db/logical_time_metadata_hook.cpp index ad9301c681e..9d14f2570e8 100644 --- a/src/mongo/db/logical_time_metadata_hook.cpp +++ b/src/mongo/db/logical_time_metadata_hook.cpp @@ -64,7 +64,7 @@ Status LogicalTimeMetadataHook::readReplyMetadata(StringData replySource, auto& signedTime = parseStatus.getValue().getSignedTime(); - // LogicalTimeMetadata is default constructed if no logical time metadata was sent, so a + // LogicalTimeMetadata is default constructed if no cluster time metadata was sent, so a // default constructed SignedLogicalTime should be ignored. if (signedTime.getTime() == LogicalTime::kUninitialized) { return Status::OK(); diff --git a/src/mongo/db/logical_time_validator.cpp b/src/mongo/db/logical_time_validator.cpp index 2248145ce3d..d17a728435c 100644 --- a/src/mongo/db/logical_time_validator.cpp +++ b/src/mongo/db/logical_time_validator.cpp @@ -85,7 +85,7 @@ SignedLogicalTime LogicalTimeValidator::_getProof(const KeysCollectionDocument& auto key = keyDoc.getKey(); // Compare and calculate HMAC inside mutex to prevent multiple threads computing HMAC for the - // same logical time. + // same cluster time. stdx::lock_guard<stdx::mutex> lk(_mutex); // Note: _lastSeenValidTime will initially not have a proof set. if (newTime == _lastSeenValidTime.getTime() && _lastSeenValidTime.getProof()) { @@ -149,8 +149,8 @@ Status LogicalTimeValidator::validate(OperationContext* opCtx, const SignedLogic const auto& key = keyStatus.getValue().getKey(); const auto newProof = newTime.getProof(); - // Logical time is only sent if a server's clock can verify and sign logical times, so any - // received logical times should have proofs. + // Cluster time is only sent if a server's clock can verify and sign cluster times, so any + // received cluster times should have proofs. invariant(newProof); auto res = _timeProofService.checkProof(newTime.getTime(), newProof.get(), key); diff --git a/src/mongo/db/logical_time_validator.h b/src/mongo/db/logical_time_validator.h index d46f1787ebf..44bb34922e5 100644 --- a/src/mongo/db/logical_time_validator.h +++ b/src/mongo/db/logical_time_validator.h @@ -42,8 +42,8 @@ class KeysCollectionDocument; class KeysCollectionManager; /** - * This is responsible for signing logical times that can be used to sent to other servers and - * verifying signatures of signed logical times. + * This is responsible for signing cluster times that can be used to sent to other servers and + * verifying signatures of signed cluster times. */ class LogicalTimeValidator { public: @@ -92,7 +92,7 @@ public: static bool isAuthorizedToAdvanceClock(OperationContext* opCtx); /** - * Returns true if the server should gossip, sign, and validate logical times. False until there + * Returns true if the server should gossip, sign, and validate cluster times. False until there * are keys in the config server. */ bool shouldGossipLogicalTime(); diff --git a/src/mongo/db/repl/read_concern_args.h b/src/mongo/db/repl/read_concern_args.h index c6794b278fb..02c729b0181 100644 --- a/src/mongo/db/repl/read_concern_args.h +++ b/src/mongo/db/repl/read_concern_args.h @@ -114,7 +114,7 @@ private: */ boost::optional<OpTime> _opTime; /** - * Read data after cluster-wide logical time. + * Read data after cluster-wide cluster time. */ boost::optional<LogicalTime> _clusterTime; boost::optional<ReadConcernLevel> _level; diff --git a/src/mongo/db/service_entry_point_mongod.cpp b/src/mongo/db/service_entry_point_mongod.cpp index fca93bfdfc5..470feb11bd1 100644 --- a/src/mongo/db/service_entry_point_mongod.cpp +++ b/src/mongo/db/service_entry_point_mongod.cpp @@ -260,7 +260,7 @@ void appendReplyMetadata(OperationContext* opCtx, if (serverGlobalParams.featureCompatibility.version.load() == ServerGlobalParams::FeatureCompatibility::Version::k36) { if (LogicalTimeValidator::isAuthorizedToAdvanceClock(opCtx)) { - // No need to sign logical times for internal clients. + // No need to sign cluster times for internal clients. SignedLogicalTime currentTime(LogicalClock::get(opCtx)->getClusterTime(), TimeProofService::TimeProof(), 0); @@ -328,7 +328,7 @@ void _waitForWriteConcernAndAddToCommandResponse(OperationContext* opCtx, /** * For replica set members it returns the last known op time from opCtx. Otherwise will return - * uninitialized logical time. + * uninitialized cluster time. */ LogicalTime getClientOperationTime(OperationContext* opCtx) { repl::ReplicationCoordinator* replCoord = @@ -346,7 +346,7 @@ LogicalTime getClientOperationTime(OperationContext* opCtx) { /** * Returns the proper operationTime for a command. To construct the operationTime for replica set * members, it uses the last optime in the oplog for writes, last committed optime for majority - * reads, and the last applied optime for every other read. An uninitialized logical time is + * reads, and the last applied optime for every other read. An uninitialized cluster time is * returned for non replica set members. */ LogicalTime computeOperationTime(OperationContext* opCtx, diff --git a/src/mongo/db/time_proof_service.cpp b/src/mongo/db/time_proof_service.cpp index 55caf06921b..19cf095acd4 100644 --- a/src/mongo/db/time_proof_service.cpp +++ b/src/mongo/db/time_proof_service.cpp @@ -75,7 +75,7 @@ TimeProofService::TimeProof TimeProofService::getProof(LogicalTime time, const K Status TimeProofService::checkProof(LogicalTime time, const TimeProof& proof, const Key& key) { auto myProof = getProof(time, key); if (myProof != proof) { - return Status(ErrorCodes::TimeProofMismatch, "Proof does not match the logical time"); + return Status(ErrorCodes::TimeProofMismatch, "Proof does not match the cluster time"); } return Status::OK(); } diff --git a/src/mongo/db/time_proof_service.h b/src/mongo/db/time_proof_service.h index 42186aab8b3..0a981632d09 100644 --- a/src/mongo/db/time_proof_service.h +++ b/src/mongo/db/time_proof_service.h @@ -36,7 +36,7 @@ namespace mongo { /** - * The TimeProofService holds the key used by mongod and mongos processes to verify logical times + * The TimeProofService holds the key used by mongod and mongos processes to verify cluster times * and contains the logic to generate this key. As a performance optimization to avoid expensive * signature generation the class also holds the cache. */ diff --git a/src/mongo/db/time_proof_service_test.cpp b/src/mongo/db/time_proof_service_test.cpp index e033a1f3047..7f1ce4a6b7d 100644 --- a/src/mongo/db/time_proof_service_test.cpp +++ b/src/mongo/db/time_proof_service_test.cpp @@ -40,7 +40,7 @@ using TimeProof = TimeProofService::TimeProof; const TimeProofService::Key key = {}; -// Verifies logical time with proof signed with the correct key. +// Verifies cluster time with proof signed with the correct key. TEST(TimeProofService, VerifyLogicalTimeWithValidProof) { TimeProofService timeProofService; @@ -50,7 +50,7 @@ TEST(TimeProofService, VerifyLogicalTimeWithValidProof) { ASSERT_OK(timeProofService.checkProof(time, proof, key)); } -// Fails for logical time with proof signed with an invalid key. +// Fails for cluster time with proof signed with an invalid key. TEST(TimeProofService, LogicalTimeWithMismatchingProofShouldFail) { TimeProofService timeProofService; |