[GODRIVER-2930] Allow setting batch size on change stream cursor Created: 02/Aug/23 Updated: 28/Oct/23 Resolved: 02/Aug/23 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Change Streams |
| Affects Version/s: | None |
| Fix Version/s: | 1.12.1, 1.11.9 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Matt Dale | Assignee: | Matt Dale |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Documentation Changes: | Not Needed | ||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||
| Description |
|
Currently you can set batch size on a ChangeStream using ChangeStreamOptions.SetBatchSize. However, that applies to both the initial "aggregate" command as well as the subsequent "getMore" commands run while iterating the change stream. That can cause a problem when starting a change stream on low- or bursty-traffic collections because the initial aggregate won't return a cursor until the batch size is filled. The tailable cursor used by a change stream is intended to wait indefinitely for updates, but the initial "aggregate" command isn't, so will time out if there aren't enough changes to fill a batch, leading to an unexpected error. Definition of done:
|
| Comments |
| Comment by Githook User [ 02/Aug/23 ] |
|
Author: {'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}Message: |
| Comment by Githook User [ 02/Aug/23 ] |
|
Author: {'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}Message: |
| Comment by Githook User [ 02/Aug/23 ] |
|
Author: {'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}Message: |
| Comment by Matt Dale [ 02/Aug/23 ] |