-
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
remove addresses from node class hash #24942
base: main
Are you sure you want to change the base?
Conversation
1990bf8
to
7c69a85
Compare
case strings.HasPrefix(target, "${unique."): | ||
return true |
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'm not actually sure there actually are values that fall into this case (the unique attributes from fingerprinting would be attr.unique
), but it was one of the test cases.
FWIW it's not entirely clear to me that the computed class hash is a useful optimization as it's currently designed -- most clusters aren't going to have uniform-enough machines around items like CPU models. Maybe we'd get more mileage out of this feature if it were based on an allowlist of attributes instead of "all attributes except ones specifically marked unique". But that's more of a design improvement than this bugfix. |
7c69a85
to
f798367
Compare
When a node is fingerprinted, we calculate a "computed class" from a hash over a subset of its fields and attributes. In the scheduler, when a given node fails feasibility checking (before fit checking) we know that no other node of that same class will be feasible, and we add the hash to a map so we can reject them early. This hash cannot include any values that are unique to a given node, otherwise no other node will have the same hash and we'll never save ourselves the work of feasibility checking those nodes. In #4390 we introduce the `nomad.advertise.address` attribute and in #19969 we introduced `consul.dns.addr` attribute. Both of these are unique per node and break the hash. Additionally, we were not correctly filtering attributes out when checking if a node escaped the class by not filtering for attributes that start with `unique.`. The test for this introduced in #708 had an inverted assertion, which allowed this to pass unnoticed since the early days of Nomad. Ref: #708 Ref: #4390 Ref: #19969
f798367
to
68cbaee
Compare
When a node is fingerprinted, we calculate a "computed class" from a hash over a subset of its fields and attributes. In the scheduler, when a given node fails feasibility checking (before fit checking) we know that no other node of that same class will be feasible, and we add the hash to a map so we can reject them early. This hash cannot include any values that are unique to a given node, otherwise no other node will have the same hash and we'll never save ourselves the work of feasibility checking those nodes.
In #4390 we introduce the
nomad.advertise.address
attribute and in #19969 we introducedconsul.dns.addr
attribute. Both of these are unique per node and break the hash.Additionally, we were not correctly filtering attributes out when checking if a node escaped the class by not filtering for attributes that start with
unique.
. The test for this introduced in #708 had an inverted assertion, which allowed this to pass unnoticed since the early days of Nomad.Ref: #708
Ref: #4390
Ref: #19969
Contributor Checklist
changelog entry using the
make cl
command.ensure regressions will be caught.
and job configuration, please update the Nomad website documentation to reflect this. Refer to
the website README for docs guidelines. Please also consider whether the
change requires notes within the upgrade guide.
Reviewer Checklist
backporting document.
in the majority of situations. The main exceptions are long-lived feature branches or merges where
history should be preserved.
within the public repository.