summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-12-23 13:55:25 -0500
committerEliot Horowitz <eliot@10gen.com>2013-12-28 21:26:52 -0500
commit438c631c48a3da079eb27cf90049f9e9eab5232f (patch)
treebb3e30b58d0e59672532359c75d24d1f3eb6ad8a
parent47297ff0f5efe253345bd692e8229b03c1ce20a0 (diff)
downloadmongo-438c631c48a3da079eb27cf90049f9e9eab5232f.tar.gz
SERVER-11611: compact now use IndexCatalog
-rw-r--r--src/mongo/db/compact.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/db/compact.cpp b/src/mongo/db/compact.cpp
index 3a22acc00a6..4ec1b7b4635 100644
--- a/src/mongo/db/compact.cpp
+++ b/src/mongo/db/compact.cpp
@@ -284,13 +284,15 @@ namespace mongo {
pm.finished();
// build indexes
- NamespaceString s(ns);
- string si = s.db().toString() + ".system.indexes";
for( int i = 0; i < nidx; i++ ) {
killCurrentOp.checkForInterrupt(false);
BSONObj info = indexSpecs[i];
log() << "compact create index " << info["key"].Obj().toString() << endl;
- theDataFileMgr.insert(si.c_str(), info.objdata(), info.objsize());
+ Status status = collection->getIndexCatalog()->createIndex( info, false );
+ if ( !status.isOK() ) {
+ log() << "failed to create index: " << status.toString();
+ uassertStatusOK( status );
+ }
}
return true;