diff options
author | Judah Schvimer <judah@mongodb.com> | 2018-04-24 16:37:18 -0400 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2018-05-03 12:01:09 -0400 |
commit | dd45579fef2bf4e212161d1e3d97666a80b08bbf (patch) | |
tree | b12df773845f5994240d8c50b0e171f277beb12a /src/mongo/db/commands/drop_indexes.cpp | |
parent | b1a7cffd3f151efe4d47864c89cf5c7cf9e884cc (diff) | |
download | mongo-dd45579fef2bf4e212161d1e3d97666a80b08bbf.tar.gz |
SERVER-34580 Plumb commit time to commit handlers when available
Diffstat (limited to 'src/mongo/db/commands/drop_indexes.cpp')
-rw-r--r-- | src/mongo/db/commands/drop_indexes.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp index f6ebf5ec180..8d8fc318eff 100644 --- a/src/mongo/db/commands/drop_indexes.cpp +++ b/src/mongo/db/commands/drop_indexes.cpp @@ -51,8 +51,8 @@ #include "mongo/db/dbdirectclient.h" #include "mongo/db/index/index_descriptor.h" #include "mongo/db/index_builder.h" +#include "mongo/db/logical_clock.h" #include "mongo/db/op_observer.h" -#include "mongo/db/repl/replication_coordinator.h" #include "mongo/db/service_context.h" #include "mongo/util/log.h" @@ -218,9 +218,8 @@ public: // This was also done when dropAllIndexes() committed, but we need to ensure that no one // tries to read in the intermediate state where all indexes are newer than the current // snapshot so are unable to be used. - auto replCoord = repl::ReplicationCoordinator::get(opCtx); - auto snapshotName = replCoord->getMinimumVisibleSnapshot(opCtx); - collection->setMinimumVisibleSnapshot(snapshotName); + auto clusterTime = LogicalClock::getClusterTimeForReplicaSet(opCtx).asTimestamp(); + collection->setMinimumVisibleSnapshot(clusterTime); result.append("nIndexes", static_cast<int>(swIndexesToRebuild.getValue().size())); result.append("indexes", swIndexesToRebuild.getValue()); |