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

label_format no longer shardable and introduces the Shardable() metho… #3137

Merged
merged 2 commits into from
Jan 7, 2021

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Jan 7, 2021

This PR introduces the Shardable() bool method to the Expr interface. Now that we have pipeline stages which affect sharding (label_format), it's easier/more straightforward to implement at the Expr itself rather than using the Operations() workaround that we had prior.

Additionally, label_format is no longer shardable (bugfix as it mutates labels on shards and thus breaks guarantees).

This also lays the groundwork for integrating the dedup addition in #3110

@@ -456,6 +478,8 @@ func (r logRange) String() string {
return sb.String()
}

func (r *logRange) Shardable() bool { return r.left.Shardable() }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this was a Expr.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, but it's called via rangeAggExpr.Shardable() -> logRange.Shardable() -> LogSelectorExpr.Shardable() so it seemed more obvious to use the same method :).

Copy link
Contributor

@cyriltovena cyriltovena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks for this.

@owen-d owen-d merged commit fd94b8d into grafana:master Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants