stripe-archive / mosql

MongoDB → PostgreSQL streaming replication
MIT License
1.63k stars 225 forks source link

support applyOps in the oplog #62

Closed azylman closed 10 years ago

azylman commented 10 years ago

Mongo has a command called applyOps that lets you apply an array of oplog entries to a mongod instance. When we used this, we noticed that MoSQL wasn't replicating these operations properly. We looked into it and it turns out that oplog entries from applyOps aren't formatted like normal oplog entries.

This change allows MoSQL to handle oplog entries from applyOps easily by calling handle_op for each operation in the array.

nelhage commented 10 years ago

Fascinating! Thanks for this, and looks good.