diff options
author | Eliot Horowitz <eliot@10gen.com> | 2014-02-28 10:58:22 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2014-02-28 14:28:48 -0500 |
commit | 914a26f51ff7ffeb28922273925318da6a6eba71 (patch) | |
tree | 8b54e37de652c425124bed594afd2b9fd411525b /src/mongo | |
parent | f18e88ffafd615d515f3359ee73f719b1667e193 (diff) | |
download | mongo-914a26f51ff7ffeb28922273925318da6a6eba71.tar.gz |
SERVER-12955: MultiIndexBlock needs to check pdfile version
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/catalog/index_catalog.h | 4 | ||||
-rw-r--r-- | src/mongo/db/catalog/index_create.cpp | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/mongo/db/catalog/index_catalog.h b/src/mongo/db/catalog/index_catalog.h index 832bc2af473..3edfabc1548 100644 --- a/src/mongo/db/catalog/index_catalog.h +++ b/src/mongo/db/catalog/index_catalog.h @@ -236,6 +236,8 @@ namespace mongo { return _getAccessMethodName( keyPattern ); } + Status _upgradeDatabaseMinorVersionIfNeeded( const string& newPluginName ); + // public static helpers static BSONObj fixIndexKey( const BSONObj& key ); @@ -246,8 +248,6 @@ namespace mongo { IndexAccessMethod* _createAccessMethod( const IndexDescriptor* desc, IndexCatalogEntry* entry ); - Status _upgradeDatabaseMinorVersionIfNeeded( const string& newPluginName ); - int _removeFromSystemIndexes( const StringData& indexName ); bool _shouldOverridePlugin( const BSONObj& keyPattern ) const; diff --git a/src/mongo/db/catalog/index_create.cpp b/src/mongo/db/catalog/index_create.cpp index 6dfd74fe0da..f4bafef7b69 100644 --- a/src/mongo/db/catalog/index_create.cpp +++ b/src/mongo/db/catalog/index_create.cpp @@ -293,6 +293,20 @@ namespace mongo { } Status MultiIndexBlock::init( std::vector<BSONObj>& indexSpecs ) { + + for ( size_t i = 0; i < indexSpecs.size(); i++ ) { + BSONObj info = indexSpecs[i]; + + string pluginName = IndexNames::findPluginName( info["key"].Obj() ); + if ( pluginName.size() ) { + Status s = + _collection->getIndexCatalog()->_upgradeDatabaseMinorVersionIfNeeded(pluginName); + if ( !s.isOK() ) + return s; + } + + } + for ( size_t i = 0; i < indexSpecs.size(); i++ ) { BSONObj info = indexSpecs[i]; StatusWith<BSONObj> statusWithInfo = |