-
Notifications
You must be signed in to change notification settings - Fork 43
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
Optimization for multi-valued LDAP attributes such as groups uniqueMember #255
Comments
Hello @coudot, I have fixes/improvements for this implemented but not uploaded/PR'd yet, I'd like to know which one would be preferred as there are two, each with pros and cons.
Both are tested to work the same, at least for the uniqueMember example provided. I like the first one less because it changes the current expected behaviour, and may break some people's usage, but it's a smaller code change. I can publish both branches to compare/see the changes, and PR the accepted one. Or I can wait until the community/maintainers decide one idea is better than the other and publish only that branch. |
I've no strong opinion on this but we should avoid to have a too complex configuration. Maybe there is no need to keep the old behavior (replace all values) and just use the new way (delete/add). Or keep the replace mode only it there is only one value in source and destination. Maybe @davidcoutadeur @soisik @rouazana can comment on this. |
Thanks for the quick reply, I've pushed the changes for the optimized FORCE policy at https://github.com/INTM-Group/lsc/tree/opti-force-policy, you can review them and make a PR directly from our branch, afaik. Otherwise, let me know and it can be done on our side easily, or maybe we should wait for the other maintainers' comments. |
Hello, This looks great, thank you for your contribution! Two remarks:
I opened the MR for more discussion here: #259 |
Hello, Thank you for your work. Would it be possible to test this as well? Is it possible to obtain a package for installation under ubuntu? Thanks, |
Hello, We tried to package the application and tested it on our test platform. Unfortunately this doesn't seem to work. The contents of the member "attribute" is completely replaced as before. We set the policy to FORCE for the attribute, do we need to do something more? Thanks for your feedback, |
Hello, Thanks again for your contribution! I have read the PR "1. optimizing" the FORCE policyType". This optimization seems really interesting. I have no particular remark on the code itself. I didn't understand the way the second solution is intended to work ("2. Involves adding two policyTypes in the XSD schema, DIFFERENCE and KEEP_SOURCE"). Could you show the source code or explain how the DIFFERENCE and KEEP_SOURCE are used? |
Did you check you had less modifications than the number of values in the source attribute? |
In fact we tested on a group of more than 100,000 members where there are less than 10 changes. |
Hello,
The second solution was to add a policyType DIFFERENCE that does delete operations on elements in the destination but not the source (like the opposite of MERGE), and a policyType KEEP_SOURCE would be the equivalent of a DIFFERENCE and a MERGE in one operation (acting just like the optimized FORCE of the first commit of the PR). They would be used for granularity/more control, but I'm not sure it's that big of a use.
I have to admit I'm not well versed in LDAP/AD workings at all, I kind of just made the changes and tested them on a few minimal examples (with a main groupOfUniqueNames object and uniqueMembers getting add/delete/replace'd to be as close to the issue as possible). It's highly probable that there are edge cases where this isn't advisable, or even break compatibility, I'll resort to your (the main contributors') advice/knowledge on this. |
Hello, According to the logs the problem seems to come from that the new value and the old value are the same: Jan 11 11:00:22 - DEBUG - In object "CN=GG_ARC,ou=structures,ou=demo,ou=groups,dc=ad-dev,dc=demo,dc=org": Replacing attribute "member": source values are [uid=toto,ou=demo,ou=people,o=annuaire, uid=alice,ou=demo,ou=people,o=annuaire], old values were [CN=alice,OU=employee,OU=demo,OU=people,DC=ad-dev,DC=demo,DC=org, CN=toto,OU=employee,OU=demo,OU=people,DC=ad-dev,DC=demo,DC=org], new values are [CN=toto,OU=employee,ou=demo,ou=people,dc=ad-dev,dc=demo,dc=org, CN=alice,OU=employee,ou=demo,ou=people,dc=ad-dev,dc=demo,dc=org] We use code from this page to update members: https://lsc-project.org/documentation/latest/synchronizegroups.html when we delete a value in member in the LDAP and we do a new sync all value are rewrite into de AD with the exception of the deleted entry like: old values were (42 entries) new values are (41 entries) also the behavior of not returning everything when there is only one modification on a list of 42 entries does not seem to work The structure of the source values (LDAP) are not the same with the AD structure, is this why it doesn't work? |
This PR is replaced by #285 |
When configuring LSC synchronization, it is currently not possible to optimize modifications to be able to make add and delete modifications for multivalued attributes containing many entries, such as groups with uniqueMember.
This can lead to slowness when used with attributes containing thousands of entries.
For exemple, i have a test group contenning multiples users:
If i add the user test04, LSC will make the modification like this:
The most optimized solution would be to do the following for large groups
https://github.com/lsc-project/lsc/issues/70
We can do add by following this function, but not for delete
The text was updated successfully, but these errors were encountered: