summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/dbcommands.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/dbcommands.cpp')
-rw-r--r--src/mongo/db/commands/dbcommands.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp
index da379905d84..537b8f1004e 100644
--- a/src/mongo/db/commands/dbcommands.cpp
+++ b/src/mongo/db/commands/dbcommands.cpp
@@ -76,6 +76,7 @@
#include "mongo/db/keypattern.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_disallow_extensions.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/op_observer.h"
@@ -1322,9 +1323,12 @@ void appendReplyMetadata(OperationContext* opCtx,
.writeToMetadata(metadataBob);
}
- if (LogicalClock::get(opCtx)->canVerifyAndSign()) {
- rpc::LogicalTimeMetadata logicalTimeMetadata(
- LogicalClock::get(opCtx)->getClusterTime());
+ auto validator = LogicalTimeValidator::get(opCtx);
+ if (validator) {
+
+ auto currentTime =
+ validator->signLogicalTime(LogicalClock::get(opCtx)->getClusterTime());
+ rpc::LogicalTimeMetadata logicalTimeMetadata(currentTime);
logicalTimeMetadata.writeToMetadata(metadataBob);
}
}
@@ -1717,7 +1721,7 @@ void mongo::execCommandDatabase(OperationContext* opCtx,
//
// TODO: SERVER-28445 change this to use computeOperationTime once the exception handling
// path is moved into Command::run()
- auto operationTime = LogicalClock::get(opCtx)->getClusterTime().getTime();
+ auto operationTime = LogicalClock::get(opCtx)->getClusterTime();
// An uninitialized operation time means the cluster time is not propagated, so the
// operation time should not be attached to the error response.