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

Missleading error message for sh.moveChunk

    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2024-09-02, CAR Team 2024-09-16
    • 1

      Recently I got an error on a sharded cluster when doing this:

      sh.moveChunk("mip.sessions", { foo: "bar" }, "shard-02") 
      
      ERROR: Collection is undergoing changes and chunks cannot be moved

      The error message is rather misleading, I almost generated a ticket, because my application was idle and balancer was not running, so I did not understand where "undergoing changes" are coming from.

      After some time, I found the reason, previously I run

      db.adminCommand({ 
         setAllowMigrations: "mip.sessions", 
         allowMigrations: false 
      }) 

      Which blocked the sh.moveChunk() command.

       
      A better error messages would be one of the following:

      • Migrations are not allowed and chunks cannot be moved
      • `allowMigrations` is set to `false` and chunks cannot be moved
      • Collection is undergoing changes or migrations are not allowed and chunks cannot be moved

       

       

            Assignee:
            robert.sander@mongodb.com Robert Sander
            Reporter:
            wernfried.domscheit@sunrise.net Wernfried Domscheit
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: