[SERVER-19521] validate should check consistency of number of index entries Created: 22/Jul/15  Updated: 07/Dec/16  Resolved: 09/Oct/15

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.2.0-rc1

Type: Bug Priority: Minor - P4
Reporter: Geert Bosch Assignee: Geert Bosch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-20286 should update WT size storer for non-... Closed
Documented
is documented by DOCS-8968 validate should check consistency of ... Closed
Related
related to SERVER-22234 Collection with a long key fails vali... Closed
related to SERVER-7326 "validate" command should perform ful... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Run the jstests/core/cappedb.js test on MongoDB 3.0.4 without fix for SERVER-19513 and then run

db.cappedb.validate() 

Sprint: Quint 9 09/18/15, QuInt A (10/12/15)
Participants:

 Description   

SERVER-19513 uncovered a missing check in the validate command. While the command outputs enough information to diagnose an inconsistency in the indexes, it does not mark the collection as invalid and does not report an error.

> t.validate({full:false})
{
	"ns" : "test.cappedb",
	"nrecords" : 5,
	"nIndexes" : 1,
	"keysPerIndex" : {
		"test.cappedb.$_id_" : 10
	},
	"valid" : true,
	"errors" : [ ],
	"warning" : "Some checks omitted for speed. use {full:true} option to do more thorough scan.",
	"ok" : 1
}



 Comments   
Comment by Githook User [ 09/Oct/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-19521: Fix lint
Branch: master
https://github.com/mongodb/mongo/commit/177e91b765ae7b966bd17a0eadf80635b0417023

Comment by Geert Bosch [ 09/Oct/15 ]

While not really as a result of this change, I noticed that section on validation talks a lot about extents and padding factors. These are MMAPv1 only notions and are not present for other storage engines.

Comment by Githook User [ 09/Oct/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-19521: Add checks for index count and data size consistency
Branch: master
https://github.com/mongodb/mongo/commit/e465af7b99fe2844a621ecb995f59f5f5316cf1d

Comment by Geert Bosch [ 04/Sep/15 ]

Without the fix for SERVER-20286, if the size-storer is inconsistent due to an unclean shutdown of the server, the user would be advices that his database is corrupt due to inconstistent index/record store counts and should be restored/resynched. However, validate(

{full:true}

) would have passed just fine and updated the size storer.

Comment by J Rassi [ 22/Jul/15 ]

Note also that multi-key indexes can have a greater number of index entries than the count of documents in the collection, and that partial/sparse indexes can have a fewer number of index entries than the count of documents in the collection.

Linking related ticket SERVER-7326 (see in particular this comment).

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