-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Proposal] Rule Matching #16888
Comments
@reta @msfroh @jainankitk |
I still don't understand how attributes are extracted from a |
This proposal is very abstract. I would like some concrete examples to understand what's going on. |
@msfroh Thanks for reviewing this!
Since it will be hard to contrive all the features and their feature specific attributes that they will use, I have kept that attribute extraction part abstract. But for WLM we will be using user principle and indices to determine a label, we can use
Can you provide more details about it ? I am not sure whether you got a chance to review #16797 . But if the mentioned issue still doesn't fill the gap, I can answer here. |
Pre-read for this issue: #16797
Please describe the end goal of this project
This document covers the Rule Matching for incoming search requests in depth. After reading this document, reader will have sound understanding of the following
Assumptions
New Rule insertion process
Rule schema
New rule insertion works pretty much how insertion in compressed trie works. But given each attribute can take N(this will be limited e,g; 5 at max) number there is a chance that two or more rules could share one of the values in their respective attribute values list.
In this case whichever rule was created or modified last will override the label for that attribute in the trie.
Attribute extraction process
Given that the Rule attributes are specific to a feature, feature will provide a construct to extract the attributes. For example WLM feature would use threadContext to retrieve the authN info and request itself to retrieve the indices.
Rule Matching Process
In a nutshell the rule matching will be per attribute trie (prefix tree) based matching. Hence ultimately we will be dealing with a list of values per attribute. How this per attribute based list is calculated, we will understand that with the help of some examples
lets say above picture captures a subpart of the in-memory rules Trie. Now following scenarios can occur while calculating possible labels for an attribute value.
Scenario - 1
When the search for the attribute value ends on a node which has a label
search_value: log_q3_2024
In this case the resulting label would be abc.
Scenario - 2
When the search ends on a node which doesn’t have a label then there are following sub scenarios
order_q3_2024
)logs_q2_2024
, in this case it would return[abc, pqr]
Now the above run down shows how the labels are decided per attribute value but given the request carries multiple values and rule also contains multiple attributes, how to calculate the final value. Now we will select the one which is occurring in all attribute based return label lists .
Lets say for a feature based label evaluation we are considering two attributes and corresponding labels as per the above algorithm are [abc, xyz] and [abc,pqr] now the resulting label here will be abc for this request.
Even with multiple lists following scenarios can occur
Low Level Design
Following UML and interaction diagrams shows the new constructs, their relationships and how they interact with each other.
InMemoryRuleEngine will save the label in ThreadContext which downstream transport actions can consume.
Supporting References
Issues
#16797
Related component
Search
The text was updated successfully, but these errors were encountered: