[SERVER-25798] Validate command gracefully handles views Created: 25/Aug/16  Updated: 08/Aug/17  Resolved: 29/Aug/16

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.3.11
Fix Version/s: 3.3.12

Type: Bug Priority: Major - P3
Reporter: Kyle Suarez Assignee: Kyle Suarez
Resolution: Done Votes: 0
Labels: read-only-views
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-8900 Document that the validate command fa... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Integration 2016-09-19
Participants:

 Description   

Currently, the validate command fails on a view namespace with an "ns not found" message. We should update the validate command to check for a view and validate its definitiion:

  • The view has no unexpected fields
  • The view does not refer to itself
  • Each field in the view definition is the correct type
  • The view has a valid aggregation pipeline

Alternatively, we can choose to not support validate on views. If this is the case, we should fail with ErrorCodes::CommandNotSupportedOnView.



 Comments   
Comment by Kyle Suarez [ 29/Aug/16 ]

Marking Documentation Changes as "Needed", so that the reference page for the validate command mentions that it fails when run on a view.

Comment by Githook User [ 29/Aug/16 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'kyle.suarez@mongodb.com'}

Message: SERVER-25798 return appropriate views error when validating a view
Branch: master
https://github.com/mongodb/mongo/commit/5aa85782d7de6810954da98a01068f223dd0081a

Comment by Kyle Suarez [ 26/Aug/16 ]

Yep; it would just be redundant checks on top of the ones we already have. Fine with making this unsupported on views.

Comment by Daniel Pasette (Inactive) [ 26/Aug/16 ]

Aren't all these checks done at creation or collmod time? This would be really only checking that the view definition as stored is not corrupted. It feels to me like we should make this return CommandNotSupportedOnView for now and tackle this later if we decide there is value there.

Generated at Thu Feb 08 04:10:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.