[SERVER-33046] Test "create" and "drop" commands on views with applyOps. Created: 31/Jan/18 Updated: 06/Dec/22 Resolved: 07/Feb/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Shane Harvey | Assignee: | Backlog - Replication Team |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | read-only-views | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Replication
|
||||
| Participants: | |||||
| Description |
|
Please add a test that creating and dropping views works with applyOps. For example, applying a "create" oplog entry should create a view:
Applying a "drop" oplog entry should delete the view:
This currently works on 3.4 and 3.6. |
| Comments |
| Comment by Spencer Brody (Inactive) [ 07/Feb/18 ] |
|
applyOps only supports applying oplog entries. I don't think we should be supporting using applyOps to apply anything other than a valid oplog entry generated by a mongodb server. |
| Comment by Kyle Suarez [ 06/Feb/18 ] |
|
Hey shane.harvey, We discussed this in Repl Team standup, and it is dubious that applying an op representing the create command will always be exactly equivalent to an op representing an insertion into system.views. Some cursory testing suggests that this "just works", but it definitely is not something we had in mind when we implemented the system. I know that batch application is different for commands than for CRUD operations, and that there may not be any atomicity guarantees about using applyOps to execute commands. spencer would be able to speak to this in more detail than myself. Would it be possible for MongoMirror to do something else to achieve what it wants to do? For example, could it simply run the create command directly, rather than rewriting oplog entries and using applyOps? |