Skip to content

hash_type "bernstein" keeps CityHash; only "default" selects Bernstein #9

Open

Description

@Guess-Who-sec

setFastConfigSettings in clconfig.go (v0.0.96, 2197165f) maps system_settings.hash_type to the fingerprint hash:

switch c.Setting.SYSTEM_SETTINGS.HashType {
case "cityhash":
    c.Setting.FingerPrintType = writer.FINGERPRINT_CityHash
case "bernstein":
case "default":
    c.Setting.FingerPrintType = writer.FINGERPRINT_Bernstein
}

Go cases don't fall through, so case "bernstein": is empty and leaves FingerPrintType at its struct default, 1 (config/config.go: FingerPrintType uint \default:"1"``), which is CityHash. So:

hash_type Hash used
unset ("") CityHash (struct default)
"cityhash" CityHash
"bernstein" CityHash
"default" Bernstein

Found while pinning gigapipe's fingerprint values (metrico/gigapipe#1060).

Compatibility. The fingerprint is stored permanently and links time_series to the samples tables, so any change here moves some deployments to a different hash and cuts new writes off from their existing series. A deployment that set hash_type: "bernstein" has been writing CityHash fingerprints, and one that set "default" has been writing Bernstein ones. Whatever is decided has to keep each existing deployment on the hash it already uses.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions