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 to the issue of the mongo doc manager adding the fields ns and _ts t... #45

Closed
wants to merge 1 commit into from
Closed

Conversation

JeffBerger
Copy link
Contributor

In the mongo document manager it assumes that a ns field is passed in the doc. In fact a ns and a _ts field are both passed in the doc to the mongo document manager and then the manager will insert the entire doc into the target mongo collection. This results in documents having a ns and a _ts field where they did not before. This fix removes those two added fields from the document before saving them to the target database.

…s to mongo documents when it copies them to the target. Now it only copies the original document without adding additional fields.
@llvtt
Copy link

llvtt commented Nov 7, 2013

Hey @JeffBerger,

The _ts and ns fields in your documents are used by mongo-connector during rollbacks, so I don't think removing them is a good idea. Specifically, if there are inconsistencies between what your source mongo cluster's oplog shows and what's on your target cluster, we need the _ts field (holding the last modification time of that document according to the oplog) to determine what documents could be inconsistent on your target cluster so we can compare them with what's in your source cluster. The ns field is necessary because we need to know what namespace in the source cluster to look in for potentially inconsistent documents. While it might seem strange that your documents in your target system are otherwise identical to those on your source system except for those two fields, they do serve an important purpose right now.

If you're interested in seeing exactly what I'm talking about, check out the rollback method in oplog_manager.py.

@llvtt llvtt closed this Nov 7, 2013
@llvtt llvtt mentioned this pull request Apr 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants