[SERVER-21694] mongodump --repair --dbpath omits many records Created: 30/Nov/15  Updated: 31/Jan/18  Resolved: 20/Apr/16

Status: Closed
Project: Core Server
Component/s: Storage, Tools
Affects Version/s: 2.6.11
Fix Version/s: 2.6.13

Type: Bug Priority: Critical - P2
Reporter: Bruce Lucas (Inactive) Assignee: Mathias Stearn
Resolution: Done Votes: 1
Labels: mmapv1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-21701 mongod --repair and db.repairDatabase... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Integration 13 (04/22/16)
Participants:

 Description   

The scan loop in mongodump repair terminates on this condition in _repairExtent in dump.cpp::

            // break when new loc is outside current extent boundary
            if ( ( forward && loc.compare( e->lastRecord ) > 0 ) || 
                 ( ! forward && loc.compare( e->firstRecord ) < 0 ) ) 
            {
                break;
            }

This is meant to be a check that the record is within the extent boundaries, however instead it is checking firstRecord and lastRecord, which are pointers to the start and end of the linked list, not the extent boundaries.



 Comments   
Comment by Githook User [ 20/Apr/16 ]

Author:

{u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'redbeard0531@gmail.com'}

Message: SERVER-21694 Correctly check for out-of-bounds records in mongodump --repair
Branch: v2.6
https://github.com/mongodb/mongo/commit/2fc48cab6ca3c9a9ddb413635d46467717b4779b

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