-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate tsdb's routing_path (#79384)
`routing_path`'s job is to put the same time series on the same node. It does that by extracting a String directly from the xcontent, hashing it, and feeding the hash into the shard selection algorithm. I'm happy with it! But it won't work properly if `routing_path` matches non-dimension fields or if it matches non-keyword dimensions. This prevents us from mapping any fields that aren't keyword dimensions that "line up" with `routing_path`. Let's talk about why `routing_path` can't do it's job if it matches any non-dimension fields. Well, imagine `routing_path` is `[dim, foo]` and only `dim` is a dimension. It'll *still* hash `foo`'s values into the routing key. So, say you get documents like: ``` {"dim": "a", "foo": "1"} {"dim": "a", "foo": "1"} {"dim": "a", "foo": "2"} ``` The third document could be routed to a different shard than the first two! Which would be a disaster because it'd cut the time series identified by `"dim":"a"` into pieces! Now let's talk about when `routing_path` matches a non-keyword dimension. Imagine `routing_path` is `[kwd, int]` and we send these documents: ``` {"kwd": "a", "int": "1"} {"kwd": "a", "int": "01"} ``` Both of these documents belong to the time series identified by `"dim":"a","int":1` but the `routing_path` code just reads strings so it'll route them into separate shards. Also bad! Also forbidden by this change.
- Loading branch information
Showing
9 changed files
with
276 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters