[SERVER-78231] Change Stream is not working with on-demand materialized views Created: 20/Jun/23 Updated: 01/Sep/23 |
|
| Status: | Needs Scheduling |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 5.0.7 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Kos Chaus | Assignee: | Katya Kamenieva |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Steps To Reproduce: |
Expected: The change in MV1 is caught by the watcher Actual: The change in MV1 is NOT caught by the watcher |
||||||||||||
| Participants: | |||||||||||||
| Description |
|
The same code works with a regular Mongo collection but doesn't catch any events happening to the on-demand materialized view.
I found the test which checks that the Change Stream is not supported for normal views. However, I didn't find any limitations/restrictions to using Change Streams with on-demand materialized views.
|
| Comments |
| Comment by Katya Kamenieva [ 01/Sep/23 ] |
|
k.chaus@efg.gg could you provide more details for steps 2,3,5. |
| Comment by Kos Chaus [ 21/Jun/23 ] |
|
Thank you for your quick reply! Sorry, my initial description had lost p.5 for some reason, where I did refresh my materialized view. Steps to reproduce:
Did I get your answer correctly that Views (including materialized views) CANNOT be watched by Change Stream API? If yes, I would expect to get a clear error when trying to watch materialized views. In my use case, MV1 has a grouped representation of an underlying collection, so it makes only sense to watch MV1, not C1.
|
| Comment by Chris Kelly [ 20/Jun/23 ] |
|
Hi k.chaus@efg.gg! Thanks for concisely summarizing the issue. Some notes:
This does not appear explicit in the change stream docs, and pointing that out is valuable for us. I'll forward this suggestion so we can get this limit clearly displayed! Christopher |