Introducing a separate command for users to cancel a resharding operation has advantages over hooking into the existing killOp command, namely customizing the error responses.
- An error will be returned if the resharding operation can no longer be canceled due to the coordinator already having begun to instruct the recipient shards to rename the temporary resharding collection.
- An error will be returned if there's no resharding operation in progress for the namespace.
- On success, the abortReshardCollection command will have waited for the coordinator to have forgotten about the resharding operation. It is therefore possible to immediately run a new reshardCollection command after the abortReshardCollection succeeds.
- The abortReshardCollection command should either require w:majority or automatically imply it.