Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible schema hashing false mismatch due to unstable msgpack map serialization #360

Open
GRISHNOV opened this issue May 12, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@GRISHNOV
Copy link
Contributor

While working on the task, it was discovered that msgpack does not guarantee the order of elements when serializing map.

Input for example:

{
  indexes = { {
      parts = { {
          exclude_null = false,
          fieldno = 2
        } }
    },
    [0] = {
      parts = { {
          exclude_null = false,
          fieldno = 1
        } }
    }
  }
}

Serializing output on different hosts:

��indexes���parts���exclude_null§fieldno��parts���exclude_null§fieldno

��indexes���parts���fieldno�exclude_null���parts���fieldno�exclude_null�

It can be seen that the fields exclude_null and fieldno have different order on different hosts.
Since this is used to get the hash and determine if the schema needs to be reloaded, we may get a false schema mismatch problem:

return digest.murmur(msgpack.encode(space_info))

It should also be noted that a similar calculation approach is used in other places:

return digest.murmur(msgpack.encode(val))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants