If the sharder is processing a node that has 0 weight, especially for all the devices on the node, the `find_local_handoff_for_part` can fail because there will be no local hand off devices available as it uses the replica2part2dev_id to find a device. However, a 0 weighted device won't appear in the replica2part2dev table. This patch extends `find_local_handoff_for_part`, if it fails to find a node from the ring it'll fall back to a local device identified by the `_local_device_ids` that is built up when the replicator or sharder was identifing local devices. This uses the ring.devs, so does include 0 weighted devices. This allows the sharder to find a location to write the shard_broker in a handoff location while sharding. Co-Authored-By: Tim Burke <tim.burke@gmail.com> Change-Id: Ic38698e9ca0397770c7362229baef1101a72788f
47 KiB
47 KiB