I just performed a rolling restart of my cluster (I needed to update a plugin), following the doc. I disabled shard allocation, restarted one node, waited until it joined the cluster, reenabled allocation, waited cluster state to be green, and repeated the process on each node.
However, I was a bit surprised to see some shards being moved from one node to another after re-enabling allocation.
I thought shards were simply going to be reassigned on the node that restarted since data was already on the disk. But some of them were moved...
What is the reason for that ? Can we do something against it ?