Great observation! While hash collisions are rare, they can still happen. In this implementation, the sorted_keys structure may store the same hash value for different virtual nodes. Currently, collisions aren’t explicitly handled, but they can be resolved by storing pairs {hash_value, virtual_node_id} instead of just hash values. This w…
Great observation! While hash collisions are rare, they can still happen. In this implementation, the sorted_keys structure may store the same hash value for different virtual nodes. Currently, collisions aren’t explicitly handled, but they can be resolved by storing pairs {hash_value, virtual_node_id} instead of just hash values. This way, when removing a server, we can accurately identify and delete the correct virtual node, even if multiple nodes share the same hash.
Great observation! While hash collisions are rare, they can still happen. In this implementation, the sorted_keys structure may store the same hash value for different virtual nodes. Currently, collisions aren’t explicitly handled, but they can be resolved by storing pairs {hash_value, virtual_node_id} instead of just hash values. This way, when removing a server, we can accurately identify and delete the correct virtual node, even if multiple nodes share the same hash.