Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

MongoDB insert not replicating after db.dropDatabase()

$
0
0

I'm new to MongoDB (inherited a project using it), so this is especially confusing.

I have a sharded replicaset between 3 ec2 instances. Everything works fine until I drop a database. The database drop replicates just fine - I can verify that - However, all subsequent inserts becomes out of sync, and only happen on the particular mongos instance the insert was performed on.

So here's the full process:

  1. Connect to mongos at primary:27017
  2. use someDatabase;
  3. db.dropDatabase();
  4. Connect to other 2 mongos and verify DB is dropped.
  5. Connect back to primary:27017 and insert a new document in that database
  6. Connect to other 2 mongos and realize the insert has not been replicated.

Everything was staying in sync until I dropped the database.

Should I not be performing these commands from from the mongos, and instead the primary replica member? I haven't figured out how to clean everything up yet to try and test that.

Thanks in advance!


Viewing all articles
Browse latest Browse all 17268

Trending Articles