Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-3708

Mongorestore incorrectly converts small negative float64 index keys to 1 instead of -1

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Tools and Replicator
    • 1

      Problem

      Mongorestore converts legacy index specs to prevent index creations on the source from erroring. For example, a legacy index (that persisted across upgrades) may have an index key value of 0. 3.4+ server versions no longer allow index key values of 0.

      It currently incorrectly converts an index key value less than -1 x 10^9 to 1 (ascending). The server treats these legacy index keys as -1 (descending).

      (see mongorestore's risk assessment.)

      Solution & Acceptance Criteria

      Mongorestore convertLegacyIndexes function should only convert float64s >= 0 to 1.

      Impact

      This bug can cause a legacy index with key less than -1 x 10^9 on the source to be built with key: 1 on the destination. This means that the destination cluster will treat the index as ascending while the source treats it as descending. This can cause unexpected performance issues for users.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jian.guan@mongodb.com Jian Guan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: