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

Data reimported on _river index recreation when Mongo collection is empty #251

Closed
golspe opened this issue Apr 9, 2014 · 5 comments
Closed

Comments

@golspe
Copy link

golspe commented Apr 9, 2014

What's the proper way to delete all data from Mongo and have that reflected in ES?

Steps taken:

  1. Load data into MongoDB
  2. Configure river plugin using these options
    "options": {
    "secondary_read_preference": true,
    "import_all_collections": true,
    "skip_initial_import": true
  3. See that data is imported into ES
  4. Delete all data from MongoDB
  5. Delete river index and ES index
  6. Recreate river index

After step #6, the data is re-imported to ES but there's no data in Mongo (db.collection.count() returns 0 on both Primary and Secondary nodes of the replica set)

@richardwilly98
Copy link
Owner

If you want to delete all data just drop the collection / database in MongoDB and delete the river and the index in ES then recreate the index.

@golspe
Copy link
Author

golspe commented Apr 21, 2014

I have tried that it when I recreate the index, the data reappears in ES. I'm assuming it's reimporting the data from the oplog but I'm not sure why. Currently running:

MongoDB 2.4.3
Elasticsearch 0.90.7
River MongoDB 1.7.3

Do I need to downgrade my ES instead and River plugin to match the version of MongoDB?

@talha-asad
Copy link

I think you should use the latest version of this plugin, i.e 2.0.0
Also i think, what you are looking for is this option: "drop_collection"

@richardwilly98
Copy link
Owner

The initial import (using the collection data and not oplog.rs) has been implemented since 1.7.1 [1].
So you should not have such issue.

Before 1.7.1 the initial import was using oplog.rs.

[1] -#47

@benmccann
Copy link
Collaborator

Sounds like this has been addressed in newer versions of the river

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

No branches or pull requests

4 participants