-
Notifications
You must be signed in to change notification settings - Fork 73
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
Fixes #17237: Do not compute dynamic groups if nothing changed in LDAP #2931
Fixes #17237: Do not compute dynamic groups if nothing changed in LDAP #2931
Conversation
|
||
override def changesSince(lastTime: DateTime): Box[Boolean] = { | ||
val n0 = System.currentTimeMillis | ||
if(n0 < lastTime.getMillis || n0 - lastTime.getMillis < 100) { |
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.
does that mean a change in the future?
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.
ah yes, it's not usefull in fact (because if the first is true, the second is also). I will remove it.
, AND(IS(OC_RUDDER_NODE), Filter.create(s"entryDN:dnOneLevelMatch:=ou=Nodes,cn=rudder-configuration")) | ||
, AND(IS(OC_RUDDER_NODE_GROUP), Filter.create(s"entryDN:dnSubtreeMatch:=groupCategoryId=GroupRoot,ou=Rudder,cn=rudder-configuration")) | ||
) | ||
, GTEQ("modifyTimestamp", GeneralizedTime(lastTime).toString) |
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.
we don't have index for that. It will be really costly on ldap
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.
also, is there a way to stop the query if one result is found ?
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.
it's actually stop on the first (or second?) hit, so it is (a bit, but still much less that group search) costly only if there's no modifications. We do something very similar for cache, and it's quite fast.
(openldap seem to be very efficient in pruning entries that he don't care on that. The fact that keys are sorted in mdb may be the reason, I don't know).
PR updated with a new commit |
This PR is not mergeable to upper versions. |
OK, squash merging this PR |
87f4d4d
to
3164d5b
Compare
https://issues.rudder.io/issues/17237