tulip / oplogtoredis

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

Test Mongo failure modes #5

Closed benweissmann closed 6 years ago

benweissmann commented 6 years ago

What happens if we lose our connection to Mongo? Or some other error occurs?

Specifically here: https://github.com/tulip/oplogtoredis/blob/85ebc4bca6b50f572160cdba078c910ebdd89c0b/main.go#L99 -- what kinds of errors could we potentially see? How can we best recover from them?

In general, once https://github.com/tulip/oplogtoredis/issues/4 is fixed, we should err on the side of exiting when we hit unexpected issues and expect whatever is supervising this process (docker, kubernetes, systemd, etc.) to restart us rather than risk continuing to run in a degraded state

benweissmann commented 6 years ago

Tested mongo unavailability; we correctly reconnect and continue to tail the oplog. In #7, we'll add a health-check endpoint that will report unhealthy if we're disconnected so the supervisor can decide what to do.