-
Type: Task
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sharding
-
Sharding
Currently, if the collection is sharded it has a document in the config.collections collection. Unsharded collections do not have document in this collection. This project makes all collections have a corresponding document in the config.collections collection. The sharding code needs to distinguish sharded and unsharded collections. This will be done by adding a sharded attribute to the CollectionType class which describes the config server's config.collections document's schema.
Implementation
- Add boost::optional<bool> _sharded private member to the CollectionType class
- Add bool getSharded() const that will return implicit true as this is the current behavior: only sharded collections are in the config.collections"
- Add void setSharded(bool) setter
- in type_collection.cpp Define the name of the _sharded attribute for serialization. Will use partitioned to match existing attribute for databases
- implement CollectionType::toBSON support for _sharded attribute
- implement CollectionType::fromBSON support for _sharded attribute
- implement CollectionType::hasSameOptions support for _sharded attribute
Test
- Unit test to implement toBSON and fromBSON roundtrip
- Unit test for hasSameOptions
- Unit test for setSharded followed by getSharded
- Unit test that the unset value of getSharded defaults to "true"