[SERVER-29354] add ability to atomically replace view definition Created: 24/May/17 Updated: 27/Oct/23 Resolved: 25/May/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Asya Kamsky | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | read-only-views | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Query
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
New description: Old description: This can be done with views, but since we don't support updating view definitions or creating views while dropping existing view definition, they would have to drop view and then re-create view which is not transparent to the applications. This ticket is to track adding an option to createView to drop/overwrite existing view definition. |
| Comments |
| Comment by Asya Kamsky [ 25/May/17 ] | ||||||||||||
|
Resolving as I don't believe there is engineering work left to do, and remaining work should be handled by | ||||||||||||
| Comment by Asya Kamsky [ 25/May/17 ] | ||||||||||||
|
We discovered via some testing that in 3.4 while it's possible to replace the definition of a view, it kills all currently running operations on it (i.e. invalidates the cursor queries are iterating over). However, due to work done to fix I believe this resolves this ticket, but it should possibly be documented that there's a change in behavior between 3.4 and 3.6. | ||||||||||||
| Comment by Asya Kamsky [ 25/May/17 ] | ||||||||||||
|
Re-opening. | ||||||||||||
| Comment by Asya Kamsky [ 25/May/17 ] | ||||||||||||
|
I'm closing this as basically dup of | ||||||||||||
| Comment by Asya Kamsky [ 25/May/17 ] | ||||||||||||
|
The use case is specifically to re-point a "logical" collection to a different physical collection. I don't think it's intended to do so "destructively" (i.e. renaming collection2 to collection would lose previous version/view of the collection). This is more analogous to there being a view called "yesterday" and it's pointing at a different collection after midnight than before, but physical collections don't change. If what Charlie listed is a feature that's meant to work then we just need to document it and then close this ticket. | ||||||||||||
| Comment by Charlie Swanson [ 25/May/17 ] | ||||||||||||
|
Isn't this what collMod does?
| ||||||||||||
| Comment by Andy Schwerin [ 24/May/17 ] | ||||||||||||
|
Sharding may make this tricky. If renameCollection in sharding worked atomically, would there be any point to doing this with views? |