tulip / oplogtoredis

Publish MongoDB oplog entries to Redis
Apache License 2.0
38 stars 9 forks source link

Pick up where we left off when we restart #4

Closed benweissmann closed 6 years ago

benweissmann commented 6 years ago

Right now, we always start tailing the oplog at the end. This means that if oplogtoredis re-starts, we'll lose all changes that occurred during the restart.

Instead, we should:

We'll need to pick some good defaults for the configuration options here (how frequently do we write the latest timestamp to Redis? How far back are we willing to go -- if oplogtoredis has been offline for hours we probably don't want to try to process all the oplog entries, but what's the cutoff? And also allow users to override these defaults.

See: https://github.com/tulip/oplogtoredis/blob/85ebc4bca6b50f572160cdba078c910ebdd89c0b/main.go#L82