When stripping UUIDs (the default), mongorestore converts createIndexes oplog commands into legacy-style oplog insertions into the system.indexes collection. This was necessary because MongoDB required a UUID for createIndexes until
SERVER-36951 (available in 3.6.9, 4.0.3).
The server removed support for system.indexes in applyOps in
SERVER-36015, causing this workaround to break.
Some possible options to fix this problem:
- Ask for
SERVER-36015to be reverted (at least the relevant parts) to preserve the legacy API
- Get buildInfo at the start of mongorestore to check the server version so we can skip the workaround for 4.1.x servers. (This would be the first version-specific behavior in the tools.)
- Remove the workaround entirely (leaving 4.2 tools broken for use with 3.6.0-3.6.8 and 4.0.0-4.0.2)