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

sh.updateZoneKeyRange() does not support $minKey or $maxKey

    • Type: Icon: Task Task
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Sharding NYC 2022-05-30

      The following commands do not seem to work on a sharded cluster, I ran them by hand through the shell:

      sh.updateZoneKeyRange("foo.bar", { "key": { "$minKey": 1 } }, { "key": { "$maxKey": 1 } }, "zone")
      sh.updateZoneKeyRange("foo.bar", { "key": { "$minKey": 1 } }, { "key": 50 }, "zone")
      sh.updateZoneKeyRange("foo.bar", { "key": 50 }, { "key": { "$maxKey": 1 } }, "zone") 

      as it complains about

      "errmsg" : "min: { key: { $minKey: 1.0 } } should be less than max: { key: { $maxKey: 1.0 } }",

      I found https://jira.mongodb.org/browse/SERVER-32862, where there is a comment "Another interesting aspect is the following" about a similar bug (different from the main bug of that issue that was fixed).

       

      Using MinKey/MaxKey like in https://www.mongodb.com/docs/manual/reference/method/sh.updateZoneKeyRange/ does work.

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            frederic.vitzikam@mongodb.com Frederic Vitzikam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: