diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/catalog/drop_indexes.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/catalog/drop_indexes.cpp b/src/mongo/db/catalog/drop_indexes.cpp index 3e212385757..d09a7a2044d 100644 --- a/src/mongo/db/catalog/drop_indexes.cpp +++ b/src/mongo/db/catalog/drop_indexes.cpp @@ -226,12 +226,16 @@ Status dropIndexes(OperationContext* opCtx, WriteUnitOfWork wunit(opCtx); OldClientContext ctx(opCtx, nss.ns()); - Status status = wrappedRun(opCtx, collection, cmdObj, result); + // Use an empty BSONObjBuilder to avoid duplicate appends to result on retry loops. + BSONObjBuilder tempObjBuilder; + Status status = wrappedRun(opCtx, collection, cmdObj, &tempObjBuilder); if (!status.isOK()) { return status; } wunit.commit(); + + result->appendElementsUnique(tempObjBuilder.done()); // This append will only happen once. return Status::OK(); }); } |