summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2020-07-22 10:27:34 +0200
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-22 11:48:25 +0000
commit86d94765b9030c9aa9adb3899277456e64bbd348 (patch)
tree44c3d16af4417684998a1ca7672522d95fae5fee /src/mongo/s/commands
parent3cab87121764327271221b205c481707c97c1c71 (diff)
downloadmongo-86d94765b9030c9aa9adb3899277456e64bbd348.tar.gz
SERVER-49321 Make VectorClock::Component protected
Diffstat (limited to 'src/mongo/s/commands')
-rw-r--r--src/mongo/s/commands/cluster_command_test_fixture.cpp3
-rw-r--r--src/mongo/s/commands/strategy.cpp3
2 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/s/commands/cluster_command_test_fixture.cpp b/src/mongo/s/commands/cluster_command_test_fixture.cpp
index ac76f060583..31bee683dbf 100644
--- a/src/mongo/s/commands/cluster_command_test_fixture.cpp
+++ b/src/mongo/s/commands/cluster_command_test_fixture.cpp
@@ -55,8 +55,7 @@ void ClusterCommandTestFixture::setUp() {
// Set up a logical clock with an initial time.
auto logicalClock = std::make_unique<LogicalClock>(getServiceContext());
LogicalClock::set(getServiceContext(), std::move(logicalClock));
- VectorClock::get(getServiceContext())
- ->advanceTime_forTest(VectorClock::Component::ClusterTime, kInMemoryLogicalTime);
+ VectorClock::get(getServiceContext())->advanceClusterTime_forTest(kInMemoryLogicalTime);
auto keysCollectionClient = std::make_unique<KeysCollectionClientSharded>(
Grid::get(operationContext())->catalogClient());
diff --git a/src/mongo/s/commands/strategy.cpp b/src/mongo/s/commands/strategy.cpp
index 63c62d6641f..13373695a05 100644
--- a/src/mongo/s/commands/strategy.cpp
+++ b/src/mongo/s/commands/strategy.cpp
@@ -123,7 +123,8 @@ void appendRequiredFieldsToResponse(OperationContext* opCtx, BSONObjBuilder* res
// The appended operationTime must always be <= the appended $clusterTime, so in case we need to
// use $clusterTime as the operationTime below, take a $clusterTime value which is guaranteed to
// be <= the value output by gossipOut().
- auto clusterTime = VectorClock::get(opCtx)->getTime()[VectorClock::Component::ClusterTime];
+ const auto currentTime = VectorClock::get(opCtx)->getTime();
+ const auto clusterTime = currentTime.clusterTime();
bool clusterTimeWasOutput = VectorClock::get(opCtx)->gossipOut(opCtx, responseBuilder);