-
Notifications
You must be signed in to change notification settings - Fork 3.8k
chore: introduce mw to route requests between v1 and v2 engines #19452
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
Conversation
💻 Deploy preview deleted. |
pkg/engine/engine.go
Outdated
} | ||
|
||
func (cfg *Config) ValidQueryRange() (time.Time, time.Time) { | ||
return time.Time(cfg.DataobjAvailableFrom), time.Now().Add(-cfg.DataobjGenerationLagDuration) |
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.
Should these return UTC times?
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.
updated. i am guessing this would only help with debugging if we print this somewhere? functionally for time comparisons, this should be a no-op
} | ||
|
||
// Merge responses | ||
return e.merger.MergeResponse(responses...) |
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.
Does the merger require responses to be sorted?
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.
it internally sorts them
sort.Sort(byFirstTime(promResponses)) |
// TODO: Add handler for v2 engine. | ||
panic("V2 engine handler not implemented") |
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.
Where is the handler created?
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.
Isn't the handler e.next
?
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 have moved this to newEngineRouterMiddleware
arguments, to be linked once we have new scheduler and its handler.
enabling v2 engine on frontend before adding this handler will reuslt in a panic.
pkg/engine/engine.go
Outdated
DataobjAvailableFrom dskit_flagext.Time `yaml:"dataobj_available_from" category:"experimental"` | ||
DataobjGenerationLagDuration time.Duration `yaml:"dataobj_generation_lag_duration" category:"experimental"` |
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.
This conflicts with #19478
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.
Moved the dataobj configs into V2EngineCfg c988114
What this PR does / why we need it:
This PR adds a new engine router middleware that breaks down the request into v1 and v2 query splits.
v1(chunks) requests are additionally split, sharded and cached same as now. v2 request is handed off to the new engine handler (yet to be implemented). This change only applies to range metric queries and log queries.
This change is intended to be a no-op if
querier.engine-v2.enable
flag is set to false on the query-frontend.Two now configs are introduced to define the time ranges for which v2 engine handling is applicable.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)feat
PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.docs/sources/setup/upgrade/_index.md
deprecated-config.yaml
anddeleted-config.yaml
files respectively in thetools/deprecated-config-checker
directory. Example PR