Recently decided to move a replica set from one data center to another, by setting up three new nodes and syncing from the originals.
Attempted to start an election and get the primary moved over to one of these three new members, however client connections started failing with this exception:
Error: Command update failed: Failed to find partial index for config.transactions. Please create an index directly on this replica set with the specification: { v: 2, key: { parentLsid: 1, _id.txnNumber: 1, _id: 1 }, name: "parent_lsid", partialFilterExpression: { parentLsid: { $exists: true } } } or drop the config.transactions collection and step up a new primary. :: caused by :: error processing query: ns=config.transactions limit=1Tree: parentLsid $eq { id: UUID("694f1c4c-a6f5-4199-b468-391e396b9c29"), uid: BinData(0, 9A6A40B2C037D20D215E64C8E0CA1B8A64380A62D5F85687CCC2C0665939E73E) } Sort: { _id.txnNumber: -1 } Proj: { _id: 1 } planner returned error :: caused by :: hint provided does not correspond to an existing index.
Created a temporary user with the anyResource and the anyAction privelligies to a role that could then be used to create the index outlined in the exception - however I’m consistently getting the below when logged in as this user:
MongoServerError: not allowed to create index on config.transactions
The role was created like so:
db.createRole({role: 'tempsuperuser',privileges:[{resource: {anyResource: true},actions: ['anyAction']}],roles: []})
And the user like:
db.createUser({user: '###',pwd: '####',roles: ['tempsuperuser']})
The 3 members work perfectly fine whilst running as visible secondaries, whilst attempting to create the index I’ve been hiding them and then changing their config so they temporarily run as a standalone instance.
Any advise on how to create the parent_lsid index on the config.transactions collection? Or have I misinterpreted the exception? Dropping the transaction collection doesn’t sound right give the docs explicitly tell you not to modify or drop them, creating the index felt like the lesser evil of the two.