- 
    Type:New Feature 
- 
    Resolution: Fixed
- 
    Priority:Major - P3 
- 
    Affects Version/s: None
- 
    Component/s: Replication, Testing Infrastructure
- 
    None
- 
        Fully Compatible
- 
        TIG 2017-08-21
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
The DocumentStructureEnumerator class added as part of SERVER-29795 always uses 0 for the scalar value in documents it generates. The UpdateSequenceGenerator class introduced in SERVER-29939 randomly selects between null, true, false, and double values between -INT_MAX and INT_MAX. In order to be able to detect idempotency issues related to different BSON types (e.g. type fidelity in $set, see SERVER-16801), we should accomodate being able to generate all possible BSON types.
To work around the lack of a BSONValue class (i.e. a BSONElement is a view into the memory owned by a BSONObj), we should use the Value class from the aggregation framework as the generic return type of some kind of generate() method.
We should have two concrete implementations of the ScalarGenerator interface:
- TrivialScalarGenerator should just return Value(0) and is what the self-tests for DocumentStructureEnumerator should use.
- RandomizedScalarGenerator should implement the existing behavior of UpdateSequenceGenerator.
- is depended on by
- 
                    SERVER-30331 Enhance RandomizedScalarGenerator to generate all kinds of BSON types for idempotency testing -         
- Closed
 
-