-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fixes unaligned shards between ingesters and storage. #4087
Fixes unaligned shards between ingesters and storage. #4087
Conversation
Currently shards computation are not correctly aligned between ingester and storage causing bad metric results. - Fixed the hash caculation which was missing the metric name `logs`. - Revert some changes from grafana@5f0e245 which was not keeping the alignement of shards. For example if the shard is 9 of 16 total, then it should also be 9 and 25 of 32. The previous commit was trying to use 10 and 11 of 32. Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment but other than that the code looks good to me!
{32, &astmapper.ShardAnnotation{Shard: 0, Of: 16}, []uint32{0, 1}}, | ||
{32, &astmapper.ShardAnnotation{Shard: 4, Of: 16}, []uint32{8, 9}}, | ||
{32, &astmapper.ShardAnnotation{Shard: 15, Of: 16}, []uint32{30, 31}}, | ||
{64, &astmapper.ShardAnnotation{Shard: 15, Of: 16}, []uint32{60, 61, 62, 63}}, | ||
|
||
// schema factor is a larger multiple of idx factor | ||
{16, &astmapper.ShardAnnotation{Shard: 0, Of: 32}, []uint32{0}}, | ||
{16, &astmapper.ShardAnnotation{Shard: 4, Of: 32}, []uint32{2}}, | ||
{16, &astmapper.ShardAnnotation{Shard: 15, Of: 32}, []uint32{7}}, | ||
|
||
// idx factor smaller but not a multiple of schema factor | ||
{4, &astmapper.ShardAnnotation{Shard: 0, Of: 5}, []uint32{0}}, | ||
{4, &astmapper.ShardAnnotation{Shard: 1, Of: 5}, []uint32{0, 1}}, | ||
{4, &astmapper.ShardAnnotation{Shard: 4, Of: 5}, []uint32{3}}, | ||
|
||
// schema factor smaller but not a multiple of idx factor | ||
{8, &astmapper.ShardAnnotation{Shard: 0, Of: 5}, []uint32{0, 1}}, | ||
{8, &astmapper.ShardAnnotation{Shard: 2, Of: 5}, []uint32{3, 4}}, | ||
{8, &astmapper.ShardAnnotation{Shard: 3, Of: 5}, []uint32{4, 5, 6}}, | ||
{8, &astmapper.ShardAnnotation{Shard: 4, Of: 5}, []uint32{6, 7}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have a check for Of
to be a multiple of totalShards
. Do we want to keep these tests or add a check for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need those. Ingester and storage uses respectively always 16 and 32. I don't think the storage will change soon enough.
Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
* Fixes unaligned shards between ingesters and storage. Currently shards computation are not correctly aligned between ingester and storage causing bad metric results. - Fixed the hash caculation which was missing the metric name `logs`. - Revert some changes from 5f0e245 which was not keeping the alignement of shards. For example if the shard is 9 of 16 total, then it should also be 9 and 25 of 32. The previous commit was trying to use 10 and 11 of 32. Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com> * better tests. Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
Currently shards computation are not correctly aligned between ingester and storage causing bad metric results.
logs
.For example if the shard is 9 of 16 total, then it should also be 9 and 25 of 32. The previous commit was trying to use 10 and 11 of 32.
/cc @owen-d @sandeepsukhani
Signed-off-by: Cyril Tovena cyril.tovena@gmail.com