[DRIVERS-2739] Add option to always use "startAfter" for changestreams Created: 29/Sep/23 Updated: 02/Oct/23 |
|
| Status: | Needs Triage |
| Project: | Drivers |
| Component/s: | Change Streams |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Unknown |
| Reporter: | Matthew Normyle | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Driver Changes: | Needed | ||||||||
| Description |
SummaryAdd option to resume change stream after receiving an "invalidate" event. MotivationAfter a change stream receives an "invalidate" event, the server closes the change stream. Callers wanting to continue receiving events are required to create a new change stream with the `startAfter` option set to the most recent `resumeToken`. An opt-in option (e.g. `ChangeStreamOptions.resumeAfterInvalidate`?) to resume using `startAfter` may provide a convenience. Who is the affected end user?Change stream users who want to continue listening for events after "invalidate". How does this affect the end user?To achieve this behavior, it requires a workaround: Track the resume token. If an "invalidate" event is received, recreate the change stream with the `startAfter` option. How likely is it that this problem or use case will occur?Not sure. If the problem does occur, what are the consequences and how severe are they?Requires a workaround. Is this issue urgent?No. There is a workaround. Is this ticket required by a downstream team?Requested by internal team described in this comment. Is this ticket only for tests?No. Acceptance CriteriaEnable change streams to continue listening after receiving an "invalidate" event.
Original ticket description: To have a change stream survive after an “invalidate”, I expect it is needed to recreate the change stream with the “startAfter” option.
|