Skip to content
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

Constraints operator "is not", "not" and "!=" doesn't work as expected with missing meta tags #1419

Closed
mclate opened this issue Jul 13, 2016 · 9 comments · Fixed by #4875
Closed

Comments

@mclate
Copy link

mclate commented Jul 13, 2016

Nomad version

Nomad v0.4.0

Operating system and Environment details

Ubuntu 140.4, docker 1.11.2

Issue

Consider having some nodes with meta "router" = true and some that doesn't have that tag.

Having constraints that look like this:

        "Constraints": [
            {
                "LTarget": "${meta.router}",
                "Operand": "is not",
                "RTarget": "1"
            }
        ]

won't start task on any node, while it is expected to be started on nodes that don't have router = true meta tag.

Here is nomad task output (i'm having 2 nodes with that tag set and 10 without it and want to start two instances in task group):

Task Group "admin":
  * Constraint "${meta.router} is not 1" filtered 8 nodes
  * Constraint "computed class ineligible" filtered 4 nodes

Expected behavior

Nomad should handle missing meta tags and do matching for is not, not and != against None (or undefined)

@mclate
Copy link
Author

mclate commented Jul 19, 2016

Any word on this one?

BTW, in documentation it says Operator (json, hcl), while nomad actually expects Operand to be passed.

@diptanu
Copy link
Contributor

diptanu commented Jul 19, 2016

@mclate I believe we fixed the documentation bug.

@mclate
Copy link
Author

mclate commented Jul 26, 2016

* Constraint "${meta.router} == ${meta.other}" filtered 7 nodes
And no allocations were created.

I'm not quite follow what "undefined behavior" this would lead to. Wouldn't it be the same behaviour as running task with no constraints only for nodes that don't have meta tag i've mentioned?

So, right now, if i don't provide any constraints, task will run on any node. I'm able to say "run only on these nodes", but how would i say "run on any nodes other than these" (without requirement to specify all possible tags on all nodes)?

Also it's not quite clear what's the difference between is and == as well as is not and !=. Looks like they do pretty much the same.

Wonder if it would make sense to use ==/!= for strict matching (where ${meta.key} != 2 would only match nodes that do have key and key doesn't equal to 2) and is/is not to be used for scenario i've described (where for is not we don't care about key presence)

@dadgar
Copy link
Contributor

dadgar commented Jul 26, 2016

Yeah I understand now. Reopening

@dadgar dadgar reopened this Jul 26, 2016
@mclate
Copy link
Author

mclate commented Jan 3, 2017

Guys, am i right assuming that this issue didn't appear in latest release (v.0.5.0)?

@dadgar
Copy link
Contributor

dadgar commented Jan 3, 2017

@mclate Correct it still hasn't been resolved. I am tentatively going to mark this for 0.6.0

@dadgar dadgar added this to the v0.6.0 milestone Jan 3, 2017
@schmichael schmichael removed this from the v0.6.0 milestone Jul 31, 2017
@marcosnils
Copy link

@dadgar @mclate this hasn't been resolved yet I assume?. Just hit the same issue and I'm force to add a tag to all my nodes so nomad doesn't exclude all of them when using a != operator.

@dadgar
Copy link
Contributor

dadgar commented Jan 24, 2018

@marcosnils Sorry still hasn't been resolved.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants