From a162b3564dbfcedc431addf6b543320c26755e6a Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Tue, 17 Feb 2015 18:20:42 -0500 Subject: SERVER-17312 collmod command now handles parsing of all arguments For the two currently supported engine-specific options, the collmod command will handle parsing the arguments and tell the CollectionCatalogEntry to update it's flags option. This removes the ability of storage engines to have custom options that can be changed after the collection is created. There were issues related to argument validation and replication of changes (including for initial sync). A correct solution will be designed as SERVER-17320. (cherry picked from commit ae18bbec33db1c4bf57d328505474eb7bba517df) Conflicts: src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.h --- .../mmap_v1/record_store_v1_simple_test.cpp | 31 ++-------------------- 1 file changed, 2 insertions(+), 29 deletions(-) (limited to 'src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp') diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp index 58a5ceeb317..6dcefefc735 100644 --- a/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp +++ b/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp @@ -42,33 +42,6 @@ namespace { using std::string; - TEST(SimpleRecordStoreV1, ChangeNoPaddingSetting) { - OperationContextNoop txn; - DummyExtentManager em; - DummyRecordStoreV1MetaData* md = new DummyRecordStoreV1MetaData( false, 0 ); - - string myns = "test.foo"; - SimpleRecordStoreV1 rs(&txn, myns, md, &em, false); - - BSONObjBuilder info; - - ASSERT_FALSE(md->isUserFlagSet(RecordStoreV1Base::Flag_NoPadding)); - - ASSERT_OK(rs.setCustomOption(&txn, BSON("noPadding" << true).firstElement(), &info)); - ASSERT_TRUE(md->isUserFlagSet(RecordStoreV1Base::Flag_NoPadding)); - - ASSERT_OK(rs.setCustomOption(&txn, BSON("noPadding" << false).firstElement(), &info)); - ASSERT_FALSE(md->isUserFlagSet(RecordStoreV1Base::Flag_NoPadding)); - - // duplicate names are expected since we reused the same builder. - const BSONObj expectedInfo = BSON("noPadding_old" << false - << "noPadding_new" << true - << "noPadding_old" << true - << "noPadding_new" << false - ); - ASSERT_EQUALS(info.done(), expectedInfo); - } - TEST( SimpleRecordStoreV1, quantizeAllocationSpaceSimple ) { ASSERT_EQUALS(RecordStoreV1Base::quantizeAllocationSpace(33), 64); ASSERT_EQUALS(RecordStoreV1Base::quantizeAllocationSpace(1000), 1024); @@ -157,7 +130,7 @@ namespace { OperationContextNoop txn; DummyExtentManager em; DummyRecordStoreV1MetaData* md = new DummyRecordStoreV1MetaData( false, 0 ); - md->setUserFlag(&txn, RecordStoreV1Base::Flag_NoPadding); + md->setUserFlag(&txn, CollectionOptions::Flag_NoPadding); string myns = "test.AllocQuantized"; SimpleRecordStoreV1 rs( &txn, myns, md, &em, false ); @@ -174,7 +147,7 @@ namespace { OperationContextNoop txn; DummyExtentManager em; DummyRecordStoreV1MetaData* md = new DummyRecordStoreV1MetaData( false, 0 ); - md->setUserFlag(&txn, RecordStoreV1Base::Flag_NoPadding); + md->setUserFlag(&txn, CollectionOptions::Flag_NoPadding); string myns = "test.AllocQuantized"; SimpleRecordStoreV1 rs( &txn, myns, md, &em, false ); -- cgit v1.2.1