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

Split querier GRPCClientConfig into separate frontend and scheduler client configs #6445

Merged
merged 10 commits into from
Oct 23, 2023

Conversation

fayzal-g
Copy link
Contributor

@fayzal-g fayzal-g commented Oct 20, 2023

What this PR does

Currently, the same GRPCClientConfig is used in the querier_worker to interact with both the query_frontend and query_scheduler - it has been discovered that this causes an issue when configuring TLS.

To illustrate:
query_frontend is issued with a Server certificate with SAN: query-frontend.dns
query_scheduler is issued with a Server certificate with SAN: query-scheduler.dns

When configuring the tls_server_name for the querier worker (-querier.frontend-client.tls-server-name), there will be an error during the TLS handshake with either the frontend or the scheduler, depending on which server name is specified in the config.

To alleviate this, an additional GRPCClientConfig has been introduced specifically for the query-scheduler - the existing config will apply only for the frontend which is what would be expected anyway given the flag -querier.frontend-client.tls-server-name, the scheduler will now use -querier.scheduler-client.tls-server-name

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@fayzal-g fayzal-g changed the title Split querier GRPC client config into two Split querier GRPCClientConfig into two Oct 23, 2023
@fayzal-g fayzal-g changed the title Split querier GRPCClientConfig into two Split querier GRPCClientConfig into separate frontend and scheduler client configs Oct 23, 2023
@fayzal-g fayzal-g marked this pull request as ready for review October 23, 2023 11:39
@fayzal-g fayzal-g requested review from a team as code owners October 23, 2023 11:39
Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

Changes look good. I'd suggest to move jsonnet/Helm changes into separate PR.

@@ -92,7 +109,8 @@ type querierWorker struct {
cfg Config
log log.Logger

processor processor
processorType processorType
Copy link
Member

Choose a reason for hiding this comment

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

Instead of introducing processorType, we could explicitly pass correct grpc client config, and perhaps (if possible) get rid of cfg field completely (there's only one other field used from it: MaxConcurrentRequests). WDYT?

@@ -44,7 +52,8 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
f.DurationVar(&cfg.DNSLookupPeriod, "querier.dns-lookup-period", 10*time.Second, "How often to query DNS for query-frontend or query-scheduler address.")
f.StringVar(&cfg.QuerierID, "querier.id", "", "Querier ID, sent to the query-frontend to identify requests from the same querier. Defaults to hostname.")

cfg.GRPCClientConfig.RegisterFlagsWithPrefix("querier.frontend-client", f)
cfg.QueryFrontendGRPCClientConfig.RegisterFlagsWithPrefix("querier.frontend-client", f)
cfg.QuerySchedulerGRPCClientConfig.RegisterFlagsWithPrefix("querier.scheduler-client", f)
Copy link
Member

Choose a reason for hiding this comment

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

If someone is setting -querier.frontend-client.* today, it won't apply to scheduler client after this PR. That's a breaking change, and it should be called out in changelog.

It could be nice if we initialized values of scheduler-client from frontend-client settings. Perhaps by checking default values? (Goal is to not break existing configurations.)

operations/mimir/querier.libsonnet Outdated Show resolved Hide resolved
@@ -250,6 +250,8 @@ mimir:
frontend_worker:
grpc_client_config:
max_send_msg_size: 419430400 # 400MiB
query_scheduler_grpc_client_config:
Copy link
Member

Choose a reason for hiding this comment

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

I'd check with @krajorama how to introduce new flag into Helm like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As suggested, will address Helm/Jsonnet changes in follow-up PR.

Comment on lines 25 to 26
'querier.frontend-client.grpc-max-send-msg-size': 100 << 20,
'querier.scheduler-client.grpc-max-send-msg-size': 100 << 20,
Copy link
Member

Choose a reason for hiding this comment

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

"100 << 20" (which should be converted to human-readable number really), is the default value, and we don't need to set it. I'd suggest removing querier.frontend-client.grpc-max-send-msg-size instead (in separate PR).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As suggested, will address Helm/Jsonnet changes in follow-up PR.

Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

Thank you. Let's make sure this is called out as a CHANGE in the changelog.

@fayzal-g fayzal-g merged commit a8fd1f3 into grafana:main Oct 23, 2023
28 checks passed
@pstibrany pstibrany mentioned this pull request Nov 6, 2023
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants