summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2015-01-29 13:38:58 -0500
committerMathias Stearn <mathias@10gen.com>2015-02-13 15:29:33 -0500
commit67eb85c5fd2658c7ca53cc30dcd9007b5a8c7fa0 (patch)
treed89a27b9979b39692d04ef4ed1fc786aab441c5c
parent88be59e3c014016f531fb0fd40017a5f280a025b (diff)
downloadmongo-67eb85c5fd2658c7ca53cc30dcd9007b5a8c7fa0.tar.gz
SERVER-17248 listIndexes WCE retry loops
-rw-r--r--src/mongo/db/commands/list_indexes.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mongo/db/commands/list_indexes.cpp b/src/mongo/db/commands/list_indexes.cpp
index 357afb0c372..55b6d7c2220 100644
--- a/src/mongo/db/commands/list_indexes.cpp
+++ b/src/mongo/db/commands/list_indexes.cpp
@@ -34,9 +34,11 @@
#include "mongo/db/catalog/collection_catalog_entry.h"
#include "mongo/db/catalog/cursor_manager.h"
#include "mongo/db/catalog/database.h"
+#include "mongo/db/concurrency/write_conflict_exception.h"
#include "mongo/db/client.h"
#include "mongo/db/clientcursor.h"
#include "mongo/db/commands.h"
+#include "mongo/db/curop.h"
#include "mongo/db/exec/queued_data_stage.h"
#include "mongo/db/exec/working_set.h"
#include "mongo/db/global_environment_experiment.h"
@@ -129,13 +131,19 @@ namespace mongo {
invariant(cce);
vector<string> indexNames;
- cce->getAllIndexes( txn, &indexNames );
+ MONGO_WRITE_CONFLICT_RETRY_LOOP_BEGIN {
+ indexNames.clear();
+ cce->getAllIndexes( txn, &indexNames );
+ } MONGO_WRITE_CONFLICT_RETRY_LOOP_END(txn, "listIndexes", ns.ns());
std::auto_ptr<WorkingSet> ws(new WorkingSet());
std::auto_ptr<QueuedDataStage> root(new QueuedDataStage(ws.get()));
for ( size_t i = 0; i < indexNames.size(); i++ ) {
- BSONObj indexSpec = cce->getIndexSpec( txn, indexNames[i] );
+ BSONObj indexSpec;
+ MONGO_WRITE_CONFLICT_RETRY_LOOP_BEGIN {
+ indexSpec = cce->getIndexSpec( txn, indexNames[i] );
+ } MONGO_WRITE_CONFLICT_RETRY_LOOP_END(txn, "listIndexes", ns.ns());
WorkingSetID wsId = ws->allocate();
WorkingSetMember* member = ws->get(wsId);