summaryrefslogtreecommitdiff
path: root/src/mongo/s/commands/strategy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/commands/strategy.cpp')
-rw-r--r--src/mongo/s/commands/strategy.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/s/commands/strategy.cpp b/src/mongo/s/commands/strategy.cpp
index 5c24d16bdc1..25ac876dfd2 100644
--- a/src/mongo/s/commands/strategy.cpp
+++ b/src/mongo/s/commands/strategy.cpp
@@ -44,7 +44,6 @@
#include "mongo/db/commands.h"
#include "mongo/db/lasterror.h"
#include "mongo/db/logical_clock.h"
-#include "mongo/db/logical_time_validator.h"
#include "mongo/db/matcher/extensions_callback_noop.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/operation_time_tracker.h"
@@ -150,29 +149,30 @@ Status processCommandMetadata(OperationContext* opCtx, const BSONObj& cmdObj) {
}
auto authSession = AuthorizationSession::get(opCtx->getClient());
- auto logicalTimeValidator = LogicalTimeValidator::get(opCtx);
- const auto& signedTime = logicalTimeMetadata.getValue().getSignedTime();
-
if (authSession->getAuthorizationManager().isAuthEnabled()) {
- auto advanceClockStatus = logicalTimeValidator->validate(signedTime);
+ auto advanceClockStatus =
+ logicalClock->advanceClusterTime(logicalTimeMetadata.getValue().getSignedTime());
if (!advanceClockStatus.isOK()) {
return advanceClockStatus;
}
} else {
- logicalTimeValidator->updateCacheTrustedSource(signedTime);
+ auto advanceClockStatus = logicalClock->advanceClusterTimeFromTrustedSource(
+ logicalTimeMetadata.getValue().getSignedTime());
+
+ if (!advanceClockStatus.isOK()) {
+ return advanceClockStatus;
+ }
}
- return logicalClock->advanceClusterTime(signedTime.getTime());
+ return Status::OK();
}
/**
* Append required fields to command response.
*/
void appendRequiredFieldsToResponse(OperationContext* opCtx, BSONObjBuilder* responseBuilder) {
- auto validator = LogicalTimeValidator::get(opCtx);
- auto currentTime = validator->signLogicalTime(LogicalClock::get(opCtx)->getClusterTime());
- rpc::LogicalTimeMetadata logicalTimeMetadata(currentTime);
+ rpc::LogicalTimeMetadata logicalTimeMetadata(LogicalClock::get(opCtx)->getClusterTime());
logicalTimeMetadata.writeToMetadata(responseBuilder);
auto tracker = OperationTimeTracker::get(opCtx);
if (tracker) {