Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This adds support for sharded MongoDB replication connections.
The checks for if a sharded connection has been provided have been updated to now allow sharded connections.
The
lastWrite?.majorityOpTime
is not available in sharded clusters, but it seems like we could use theclusterTime
for the initial snapshot in this case.This has been tested locally with a MongoDB Atlas sharded cluster. Testing included:
drop
events not progressing the checkpoint.msg == 'isdbgrid
was also used to guard against unsupported Atlas Serverless instances. I tested an Atlas Flex Tier DB (which is meant to be the replacement for Serverless) and noticed that making changes on Atlas while the service has been stopped and then resuming the service would cause all data to be cleared from clients which have already synced. As a side note: interestingly when connecting this flex instance themsg
value isundefined
and notisdbgrid
. We may need some other check to guard against these instances.