-
Notifications
You must be signed in to change notification settings - Fork 10
feat: implement regions #364
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -281,6 +281,19 @@ type Config struct { | |
| // Specify how many tokens can be checked using regular expressions. | ||
| // If zero then there is no limit. | ||
| MaxRegexTokensCheck int `config:"max_regex_tokens_check" default:"0"` | ||
|
|
||
| // Regions configures the proxy to query only remote regions (other seq-proxies via store API). | ||
| // When set, hot_stores, hot_read_stores, write_stores, read_stores must be empty. No bulk; search only. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Even with proxy setup I still can configure hot_stores: However, I can't use them: I guess, we could validate config that |
||
| Regions struct { | ||
| // UseRegions is whether to use regions or not | ||
| UseRegions bool `config:"use_regions"` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. currently, config looks like that: We repeat I think it would be cleaner to have just: |
||
| // Regions maps region name to store API gRPC address (e.g. "eu" -> "eu-proxy:9004"). | ||
| Regions map[string]string `config:"regions"` | ||
| // MaxConcurrent limits how many regions are queried in parallel per search (0 = no limit). | ||
| MaxConcurrent int `config:"max_concurrent" default:"0"` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's hard to tell what
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Honestly, I would just remove these Max* options altogether. Yes, we'll have 300+ regions, but it seems like a manageable task to merge the results, especially once we have streaming single-phase search. |
||
| // MaxRegionsPerRequest is the maximum number of regions a client can specify in one search request (e.g. 5). | ||
| MaxRegionsPerRequest int `config:"max_regions_per_request" default:"5"` | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Honestly, I would just remove these Max* options altogether. Yes, we'll have 300+ regions, but it seems like a manageable task to merge the results, especially once we have streaming single-phase search. |
||
| } `config:"regions"` | ||
| } `config:"experimental"` | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,4 +17,6 @@ var ( | |
| MaxRegexTokensCheck int | ||
|
|
||
| FailPartialResponse = false | ||
|
|
||
| UseRegions = false | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: I would avoid creating yet another global config variable. They create complications down the road (leaky abstraction). Everywhere we use this variable, there is indirect data in the context about whether regions are enabled or not, so we can easily do without this variable. |
||
| ) | ||
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.
nit: For better readability, let's just extract this setup logic into a separate function, which in turn will call one of two functions - for the experimental config or for the traditional one.