-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[WLM] Automated labeling of search requests #16797
Comments
@msfroh @reta @jainankitk @backslasht @andrross |
If we want to separate out the rules for features then having limited choice based value for additional field mentioning which feature would use the rule. the schema could look like following
|
Thanks @kaushalmahi12 (sorry for the delay).
I think this is the right approach to manage rules. Also, I suspect the labeling (rule matching) should only be applied on coordinator node(s)? Regarding the data structures, I think it would be great to understand how exactly the attributes to match against are extracted from the search requests, do we have an RFC/Feature Request for it? (sorry if I missed it) |
Thanks @reta for looking into it.
Not sure if I follow completely but IMO the mapping should be 1:1 from a user level request and how we treat it within the system. With that being said maybe |
|
There are 2 choices for that.
|
Thanks @kaushalmahi12 for putting together this RFC. Few comments:
IMO, only admins should be able to define the rules for assigning labels for Workload Management.
IMO, the evaluation can be on the coordinator node or data node, depending on the type of rule. For example - if we allow box_type as one of the possible attributes, the evaluation for that rule should be on the data node I feel the RFC is focusing on both the high level details as well as low level implementation details. IMO, we should keep this RFC limited to the customer experience we are planning to build. The low level implementation design discussion is better done as followup in separate RFC. |
It would be nice to have a specification of the semantics of tag inferencing before going into implementation. |
1. Introduction1.1 PurposeThis document specifies the requirements and functionality for the Workload Management feature in OpenSearch, which uses autotagging to categorize incoming search requests into QueryGroups. We will use Rules to categorize the search requests. Rules will be managed by Admin users using Rest APIs and later we can provide a UI for managing them. 1.2 ScopeThe feature covers the creation, management, and application of rules for categorizing search requests into QueryGroups(workload groups). The feature should also be reusable for other components or use cases as well if need be in the future. Feature should also be flexible enough to accomodate for other attributes in the future to decide the query group or some other label. 1.3 Definitions
To understand little bit more about the existing constructs and feature : WLM Overview
1.4 Use cases this feature will solve
System OverviewWLM is designed to ensure of resource isolation amongst workload groups. But the system is missing the capability to automatically categorize the incoming requests into query groups (workload groups). Goals
3 Functional Requirements
|
@kaushalmahi12 - Thank you for the revision and putting more emphasis on the user experience. Few comments:
I am wondering if it is better specified as key-value pair. For example:
|
Yes.
I think this is little better!. Thanks @jainankitk for the suggestion.
I think either is fine since both of them are conveying the intent partially here. as long as the documentation is detailed enough it should be fine IMO.
Index pattern resolution happens after
Yes we will and the last updated rule value will be updated. |
Author: Kaushal Kumar
Is your feature request related to a problem? Please describe
Recently we launched WLM subfeature i,e; multitenant search resiliency. But the feature still required an external hint to be sent along with each request via HTTP header. Hence this approach puts the burden on the user to apply these hints intelligently.
This can become a real pain if the access is programmatic and if not planned properly the programmatic multitenant access can become unmanageable. Hence it would rather be great if user could just define some rules to determine what should be the right tenant for certain class (confirms to a rule) of request.
Though we have touch based on this idea in the following RFCs
In this issue I want to go over the high level approach to achieve this.
Describe the solution you'd like
Given that this tagging component will lie directly on the search path, we will keep efficient in memory snapshot of the rules for faster processing. The label assignment will only happen once for a request at co-ordinator node irrespective of number of shards it is going to hit.
Rules schema and Storage options
Rule Schema
In-memory Structure for Rules
Since we want to hold all the rules in memory and do a fast prefix based string matching trie data structure becomes a natural choice for this problem.
We will keep per attribute trie in memory, each trie will give us a possible list of matching labels.
Rules storage
Following diagram illustrates the rules storage process and how does the structure evolves over time on incremental rule additions [Note: in the diagrams I have used query groups but this will be a generic label which other features can also use]
Rules Matching
Given that the rules are stored in in-memory trie data structure, single attribute value match could yield multiple results. Now there are following scenarios for the string search in the trie
Now given these N lists of matches, 1 per attribute. We can select an item which will appear in most number of lists and if there is a tie then pick the one with shortest depth in the tree. If the match results in a tie even with depth as a param we will use first query group from the list lexicographically.
Related component
Search
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: