Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change stream enhancements #326

Open
wants to merge 16 commits into
base: development
Choose a base branch
from

Conversation

rwynn
Copy link

@rwynn rwynn commented Jan 25, 2019

This PR includes a set of changes to change streams based on my testing

  • Fixes an issue with a stuck change stream by removing special cases (e.g. iter.isChangeStream) and treating the change stream as a wrapper around a normal iterator.
  • Fix the scenario where the iterator returns no results so the changeStream reports a timeout but the soft error on the iterator was not being reset, so the same timeout result happens repeatedly forever without fetching any new results.
  • Adds the ability to set the startAtOperationTime option for MongoDB 4.0+
  • Fixes some of the logic so that it is consistent across all change domains. Previously, the resume function would always reference the collection even if the change stream was created for a db or cluster.

@rwynn rwynn changed the title Change stream fixes Change stream enhancements Jan 27, 2019
@rwynn
Copy link
Author

rwynn commented Jan 30, 2019

@eminano I've just added one final change to the PR after some more testing. It seems during the resume the batch size and max time settings were not being applied to the new pipe.

on the iterator in order to do this correctly otherwise we
end up in a Next() loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants