[SERVER-38265] Change Stream Events on sharded clusters are not returned in real time Created: 27/Nov/18 Updated: 27/Oct/23 Resolved: 30/Nov/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Performance, Sharding |
| Affects Version/s: | 4.0.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kurt Agius | Assignee: | Eric Sedor |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL | ||||||||||||||||||||||||||||||
| Steps To Reproduce: | 1. Setup sharding as shown below:
2. Run the snippet as shown below:
|
||||||||||||||||||||||||||||||
| Participants: |
| Description |
|
When using a sharded setup, trying to tail changestream via mongos (as suggested by the docs), returns changes in "batches" instead of live. If you tail the changestream via the replicaset directly (which is not the point, because you want to use sharding), then it works as expected i.e updates come in "live" not in "batches". You can see if an update is coming in "live" or "delayed" by printing the time difference between now & the clusterTime (from the received change). This is tested this against:
They all reproduce the same effect. |
| Comments |
| Comment by Eric Sedor [ 30/Nov/18 ] |
|
Hi Kurt, thanks for your patience. This is expected for the reasons described in our change stream production recommendations for sharded clusters. If you'd like to discuss this further, please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-user group. |