[SERVER-80177] validate() should not return valid:false for non-compliant documents Created: 16/Aug/23  Updated: 02/Nov/23  Resolved: 02/Nov/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 6.0.9
Fix Version/s: 7.2.0-rc0

Type: Task Priority: Major - P3
Reporter: Eric Sedor Assignee: Binh Vo
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-43325 Not all exceptions inside collection ... Backlog
related to SERVER-53635 Add document schema validation to val... Closed
Assigned Teams:
Storage Execution NAMER
Backwards Compatibility: Minor Change
Sprint: Execution NAMR Team 2023-10-16, Execution Team 2023-10-30, Execution Team 2023-11-13
Participants:

 Description   

I believe document noncompliance should be a warning, not an error, and validate() should return valid:true for a result like:

{u'nNonCompliantDocuments': N, u'errors': [u"Detected one or more documents not compliant with the collection's schema. Check logs for log id 5363500."], u'nrecords': N, u'keysPerIndex': {...}, u'corruptRecords': [], u'advice': u'A corrupt namespace has been detected. See http://dochub.mongodb.org/core/data-recovery for recovery steps.', u'warnings': [], u'indexDetails': {...}, u'valid': False, u'extraIndexEntries': [], u'ok': 1.0, u'nInvalidDocuments': 0, u'ns': u'db.collection', u'repaired': False, u'nIndexes': N, u'missingIndexEntries': []}

In sum, for this failure, I think:

  • error should be a warning
  • advice should not say "corrupt namespace"
  • valid should be true


 Comments   
Comment by Githook User [ 02/Nov/23 ]

Author:

{'name': 'Binh Vo', 'email': 'binh.vo@mongodb.com', 'username': 'binhvomongodb'}

Message: SERVER-80177 Add option for validate to return schema validation violations as warnings
Branch: master
https://github.com/mongodb/mongo/commit/19e5a6738234ce0137a53079799ec4507dea9e4d

Generated at Thu Feb 08 06:42:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.