Instead of hashing the key to a shard id which identifies a physical machine we could map it to a logical shard ids say L1 L2 …LN as shown on the ring .
Then one of the nodes which stores configuration of the system can keep a mapping from logical shard id o physical machine id.
Say L1 L5 and L20 map to machine P1 and replicated on P2.
So when P1 goes down it’s data distributes to 3 physical machines corresponding to next logical id on ring namely L2 , L6 and L21 thereby distributing it’s load.
This also helps the system to add more capacity by adding more machines under the hoods and redistributing logical shard ids among them.