Monorestore failing while trying to restore oplogdump

Z:\pbm_backup>mongorestore --port 27018 --oplogReplay oplogDump
2021-03-31T08:52:49.238+0000 preparing collections to restore from
2021-03-31T08:52:49.284+0000 replaying oplog
2021-03-31T08:52:49.300+0000 skipping applying the config.system.sessions namespace in applyOps
2021-03-31T08:52:49.301+0000 skipping applying the config.system.sessions namespace in applyOps
2021-03-31T08:52:49.302+0000 skipping applying the config.system.sessions namespace in applyOps
2021-03-31T08:52:49.302+0000 skipping applying the config.system.sessions namespace in applyOps
2021-03-31T08:52:49.303+0000 Failed: restore error: error applying oplog: createIndex error: cannot transform type primitive.D to a BSON Document: Key partialFilterExpression of inlined map conflicts with a struct field name
2021-03-31T08:52:49.304+0000 0 document(s) restored successfully. 0 document(s) failed to restore.

Z:\pbm_backup>

Hi @Sameer_Kattel, what’s the output of mongorestore --version?

Hi @Tim_Fogarty

It’s latest

C:\Users\DevAdmin>mongorestore --version
mongorestore version: 100.3.1
git version: 32632b931f9c41d8314b75ecc88e551b012b1e30
Go version: go1.15.8
os: windows
arch: amd64
compiler: gc

C:\Users\DevAdmin>

Thanks for the info. I was able to reproduce this bug. Mongorestore cannot properly parse createIndexes or commitIndexes oplog entries if the index being created has a partialFilterExpression. I have opened the Jira ticket TOOLS-2833 to track this bug. I just made the fix and it should be available in the next release of Database Tools.

If the version of MongoDB you dumped from and the version you are restoring to are both less than 4.4, then version 100.0.2 of the tools should work.

If you are using version 4.4 of the server, you will have to wait for the next release or use a different dump if possible.

If this isn’t possible you can build a version of the tools from the git branch which contains the fix. People often have difficulties building the tools on Windows, so that should only be a last resort if there’s no other workaround.

2 Likes

Thanks for the suggestions.

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