choose_oid fed ceph_str_hash_linux straight into % max_objs, and the
low bits of that hash are weak enough that similar object names keep
landing on the same shard. LC takes the hash mod HASH_PRIME first for
exactly this reason, do the same here.
Signed-off-by: Matthew N. Heler <matthew.heler@hotmail.com>
int Restore::choose_oid(const RestoreEntry& e) {
int index;
const auto& name = e.bucket.name + e.obj_key.name + e.obj_key.instance;
- index = ((ceph_str_hash_linux(name.data(), name.size())) % max_objs);
+ index = ((ceph_str_hash_linux(name.data(), name.size())) % HASH_PRIME % max_objs);
return static_cast<int>(index);
}