NaN index key values can cause mongorestore to fail

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Tools and Replicator
    • 55

      Problem

      max.hirschhorn@mongodb.com had a comment in the legacy index conversion IA:

      Additionally, a key pattern with a literal NaN value won't be coerced. New index builds have their key patterns validated as v:2 indexes would and so a literal NaN value would result in the index build failing.

      An index with value NaN can be created with pre-3.4 server versions and upgraded to a supported source version. Mongosync is not handling it as part of legacy index conversion, and thus causing failure when creating it on the destination.

      Solution & Acceptance Criteria

      Since it's treated as an ascending index according to the server test, we should convert NaN index key value to 1.

      Impact

      One less edge case that mongorestore fails upon.

            Assignee:
            Unassigned
            Reporter:
            Jian Guan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: