Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mongorestore --oplogReplay #19

Closed
wants to merge 1 commit into from
Closed

Fix mongorestore --oplogReplay #19

wants to merge 1 commit into from

Conversation

viotti
Copy link

@viotti viotti commented May 21, 2015

Running mongorestore with the --oplogReplay command line option fails if the dump/oplog.bson file is larger than 16MB. It prints the following error message.

Failed: restore error: error applying oplog: applyOps: EOF

I think the problem is on line 17 of mongorestore/oplog.go. The oplogMaxCommandSize constant is defined as 16.5 MB, even though the MongoDB maximum document size is 16 MB!?! This causes an exception on the server side which closes the applyOps command cursor, hence the EOF message.

I'm not sure why, but setting oplogMaxCommandSize to 1024 * 1024 * 16 did not fix the problem for me. But setting it to 1024 * 1024 * 15 made the bug go away.

There is also a report of this bug on StackOverflow.

Running `mongorestore` with the `--oplogReplay` command line option was failing when the `dump/oplog.bson` file was larger than 16MB.
@3rf
Copy link
Contributor

3rf commented May 28, 2015

Rafael, Thank you for filing this issue, and very sorry you were hit by this. We appreciate that you put up a pull request to bring this to our attention. There is a tracking ticket for the issue on our Jira here: https://jira.mongodb.org/browse/TOOLS-754

In order to push a fix for a bug like this, it was essential for us to have a comprehensive integration test to confirm a fix against. Using this report, I was able to create one and then fix the issue. I've just deployed those changes to the master and v3.0 branches.

Thank you again for alerting us to this issue.

@3rf 3rf closed this May 28, 2015
@viotti viotti deleted the fix-mongorestore-oplog branch May 28, 2015 18:54
@viotti
Copy link
Author

viotti commented May 28, 2015

You're welcome. Thanks for reviewing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants