Closed msamblanet closed 9 years ago
This makes a lot of sense. Hopefully this library gets some attention, I've had to move away from it due to errors, speed, and this reconnect/reset thing.
@msamblanet @jdarling mongo-oplog@1.0.0 is out with latest fixes. Thanks for reporting issues and for being patient
Right now, if a cursor timeout is received then
tail()
is called again. However, it will restart the tail with the same since value as originally requested as opposed to resuming where it was left off, resulting in duplication of any transactions still in the oplog but already delivered to the application.A similar thing happens if you want to
stop()
and then calltail()
again later to resume. In my case, I want to do this if I get DB transactions in faster than I can process them, effectively using the oplog as a buffer against activity spikes.I believe simply updating
this.ts
inside of ondata to bedoc.ts.getHighBits()
would provide for this.If this makes sense and assuming I did not miss anything, I could likely provide a PR some time in the next couple weeks if it would help.