summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-02-27 09:51:22 -0500
committerEliot Horowitz <eliot@10gen.com>2013-02-27 09:51:22 -0500
commit9a7c92638a28c21bd1e883c85ecee2f41a67ca4b (patch)
tree8ab221d9ea91420420909d9eeba19cb2061966e6
parent6a2ab90b67fb496d34a77a4315c3ebd730ed7a8b (diff)
downloadmongo-9a7c92638a28c21bd1e883c85ecee2f41a67ca4b.tar.gz
SERVER-8757: reset index cache at beginning and end of background index creation
-rw-r--r--src/mongo/db/index_update.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/index_update.cpp b/src/mongo/db/index_update.cpp
index c38a3ccf4c7..741b1285c51 100644
--- a/src/mongo/db/index_update.cpp
+++ b/src/mongo/db/index_update.cpp
@@ -522,6 +522,11 @@ namespace mongo {
BackgroundIndexBuildJob(const char *ns) : BackgroundOperation(ns) { }
unsigned long long go(string ns, NamespaceDetails *d, IndexDetails& idx) {
+
+ // clear cached things since we are changing state
+ // namely what fields are indexed
+ NamespaceDetailsTransient::get(ns.c_str()).addedIndex();
+
unsigned long long n = 0;
prep(ns.c_str(), d);