diff options
author | Lingzhi Deng <lingzhi.deng@mongodb.com> | 2019-10-03 01:50:48 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-03 01:50:48 +0000 |
commit | ef5c6b85dd873b69a12d919932e54c7b6711b14d (patch) | |
tree | a6294552175df0dc291a3a19f40d004f4b7f6141 /src/mongo/db/write_concern.cpp | |
parent | 14b7efe1c6b5a00eac88e12c42ad31730db18fec (diff) | |
download | mongo-ef5c6b85dd873b69a12d919932e54c7b6711b14d.tar.gz |
SERVER-43252: Only compute WriteConcernResult.writtenTo for CmdGetLastError
Diffstat (limited to 'src/mongo/db/write_concern.cpp')
-rw-r--r-- | src/mongo/db/write_concern.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp index a1ea9c5bf92..70b9e22dbb3 100644 --- a/src/mongo/db/write_concern.cpp +++ b/src/mongo/db/write_concern.cpp @@ -218,8 +218,7 @@ Status waitForWriteConcern(OperationContext* opCtx, } // needed to avoid incrementing gleWtimeStats SERVER-9005 - if (writeConcernWithPopulatedSyncMode.wNumNodes <= 1 && - writeConcernWithPopulatedSyncMode.wMode.empty()) { + if (!writeConcernWithPopulatedSyncMode.needToWaitForOtherNodes()) { // no desired replication check return Status::OK(); } @@ -233,10 +232,6 @@ Status waitForWriteConcern(OperationContext* opCtx, result->wTimedOut = true; } - // Add stats - result->writtenTo = replCoord->getHostsWrittenTo(replOpTime, - writeConcernWithPopulatedSyncMode.syncMode == - WriteConcernOptions::SyncMode::JOURNAL); gleWtimeStats.recordMillis(durationCount<Milliseconds>(replStatus.duration)); result->wTime = durationCount<Milliseconds>(replStatus.duration); |