In the LogicalSessionCache on replica sets, both primaries and secondaries attempt to create the sessions collection or its indexes. The secondary should only check that the collection and indexes exist before performing operations. The primary will be responsible for both creating the collection and ensuring that the indexes exist.
- In SessionsCollection::setupSessionsCollection, have secondaries instead check for collection and index existence. If either doesn't exist, return an error status. Otherwise, continue.
- is duplicated by
SERVER-36954 server keeps trying to create an index on system.sessions
SERVER-40441 Arbiter nodes log error messages when try to create session collection or check if it exists