-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: 7.0.12
-
Component/s: None
-
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