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

master/slave looks at on-disk size on a resync

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.9, 3.3.8
    • Component/s: Replication
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Backport Completed:

      Description

      The WiredTiger inMemory storage engine originally returned zero as the on-disk size for collections.

      The replication sub-system assumes on-disk sizes will be non-zero whenever there is content.

      Further analysis from Sue LoVerso:

      I think it is the primary looking at the on-disk size to determine what to send to a secondary on a resync. I believe the code in mongo/db/repl/master_slave.cpp:423:forceResync() is the code in question. The listDatabases() command in mongo/db/commands/list_databases.cpp adds an empty boolean of true if the size on disk returned is 0. Then the forceResync code calls resyncDrop if it is empty. There are no comments nearby for that decision.

      There's currently a hack in WiredTiger (see __im_handle_size) to never return a storage size of 0.

      It would be good to understand the MongoDB code, and if possible, remove the WiredTiger hack.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: