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

Fatal crash of mongodb config server after issuing malformed reshardCollection command

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 8.0.4
    • Component/s: None
    • Environment:
      Mongodb 8.0.4
    • Cluster Scalability
    • ALL
    • Hide

      I set up a reproducer repository: https://github.com/luca-nardelli/mongodb-config-server-crash-reproducer

      Please make sure to wait for the resharding operation to get to the commit stage, that's when the config server crashses.

      Show
      I set up a reproducer repository: https://github.com/luca-nardelli/mongodb-config-server-crash-reproducer Please make sure to wait for the resharding operation to get to the commit stage, that's when the config server crashses.

      When issuing a reshardCollection command with `zones`, and when these zones are malformed, the resharding never completes and the config server starts crashing after reaching the "commit" stage.

      Example of a malformed reshardCollection command

      db.adminCommand(
        {
        reshardCollection: 'test.test',
        key: {field: 1},
        forceRedistribution: true,
        zones: [
          {
            zone: 'shard-0',
            min: { field: 'MinKey' },
            max: {
              field: '0x8888888888888888888888888888888888888888'
            }
          },
          {
            zone: 'shard-1',
            min: {
              field: '0x8888888888888888888888888888888888888888'
            },
            max: { field: 'MaxKey' }
          }
        ]
      }
      ) 

      Note that MinKey and MaxKey are strings and not instances of MinKey() or MaxKey(). In my case, this happened because I was generating the zones array via a script.

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            lucanardelli91@gmail.com Luca Nardelli
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: