Failed to find partial index for config.transactions

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.

These look to be related:

The first one specifically looked promising, but I think the flag has since been removed

And the cluster already has a FCV of 6.0

Based on this commit, believe I should be able to run the effected member briefly as a standalone, downgrade the FCV, then upgrade it again to get it to auto create.

Creating the index isn’t bypassing this, which is meant to allow you to create this specific partial index, but guess the below isn’t matching up exactly to that internal definition?

db.getCollection("transactions").createIndex({ parentLsid: 1, "_id.txnNumber": 1, _id: 1 }, { name: "parent_lsid", partialFilterExpression: { parentLsid: { $exists: true } } })

Based on this commit, believe I should be able to run the effected member briefly as a standalone, downgrade the FCV, then upgrade it again to get it to auto create. ← this ended up being the answer, based on the source code linked I believe the createIndex command should also have worked, but the definition output in the exception either doesn’t match, the resulting createIndex command I tried was wrong, or the logic in that isCreatingInternalConfigTxnsPartialIndex condition is broken.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.