- 
    Type:Bug 
- 
    Resolution: Fixed
- 
    Priority:Major - P3 
- 
    Affects Version/s: None
- 
    Component/s: None
- 
    None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
- 
        None
When we batch sessions for the endSessions command, the BSON array we generate after the first batch does not have indexes starting from 0. This causes a server error. Per the spec, we ignore errors for endSessions and I don't think we have tests that cause more than 10000 sessions to be pooled so this is missing test coverage.
Writing a test in mongo/integration would be expensive because we'd need to create 10k sessions, but we can write a test in mongo to manually reduce the batch size and use command monitoring to make assertions.