Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-29197

Dangling index records when initial syncing node clones a capped collection that deletes records during collection scan

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 3.4.6, 3.5.9
    • Affects Version/s: 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4
    • Component/s: Index Maintenance
    • Labels:
    • Fully Compatible
    • ALL
    • v3.4
    • Storage 2017-05-29, Storage 2017-06-19

      During an initial sync of a capped collection, the collection scan reads until it hits EOF. If records are inserted on the sync source during the collection scan, the scan may read more documents than the collection cap allows, which will result in records being deleted during the collection scan.
      The collection cloner for initial sync uses a MultiIndexBlock builder, which does not expect records to be deleted while it builds indexes. If records are deleted before the MultiIndexBlock commits at the end of the collection scan, it can leave dangling index records pointing to deleted records. On WiredTiger, this simply results in an error when the index records are scanned. On MMAPv1, the index records point to invalid record data, which may or may not produce a BSON parsing error that looks like this:

      2017-05-15T09:45:48.697-0400 I -        [conn3] Assertion: 10334:BSONObj size: -286331154 (0xEEEEEEEE) is invalid. Size must be between 0 and 16793600(16MB) First element: _id: ObjectId('5919b0b5f337b48af7a0be4d') src/mongo/bson/bsonobj.cpp 58

      The collections in question will fail an index validation by the validate command. To repair this issue, run the reindex command.

            milkie@mongodb.com Eric Milkie
            milkie@mongodb.com Eric Milkie
            0 Vote for this issue
            8 Start watching this issue