Skip to content

LegacyShardManager fails to resolve shard when Hasher returns Integer.MIN_VALUE #140

@phaneesh

Description

@phaneesh

LegacyShardManager fails to resolve shard for specific keys if the Hasher returns Integer.MIN_VALUE. This will result in a buckeId that is outside the range (0-1000) in this case.

Example:

int hashKey = Hashing.murmur3_128().hashString("MRT2509051351592369928055", StandardCharsets.UTF_8).asInt();
hashKey *= hashKey < 0 ? -1 : 1;
System.out.println(hashKey); //Prints Integer.MIN_VALUE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions