RANGER-5696: Added deltaSyncServerType config to optimize delta sync … - #1218
Open
krishnamuttevi wants to merge 2 commits into
Open
RANGER-5696: Added deltaSyncServerType config to optimize delta sync …#1218krishnamuttevi wants to merge 2 commits into
krishnamuttevi wants to merge 2 commits into
Conversation
…filters for AD/LDAP
spolavarpau1
reviewed
Sep 9, 2026
| return groupSearchFirstEnabled; | ||
| } | ||
|
|
||
| public String getDeltaSyncServerType() { |
Contributor
There was a problem hiding this comment.
I don't think we need this method. Instead have this logic in LdapUserGroupBuilder.java
Contributor
Author
There was a problem hiding this comment.
Thanks for suggestion, I have removed the function and added the logic in LdapUserGroupBuilder.java
|
|
||
| if (config.isDeltaSyncEnabled()) { | ||
| extendedUserSearchFilter = "(objectclass=" + userObjectClass + ")(|(uSNChanged>=" + deltaSyncUserTime + ")(modifyTimestamp>=" + deltaSyncUserTimeStamp + "Z))"; | ||
| if ("ad".equalsIgnoreCase(deltaSyncServerType)) { |
Contributor
There was a problem hiding this comment.
Add a private method that returns extendedUserSearchFilter value and move the below logic there.
Contributor
Author
There was a problem hiding this comment.
I have updated the logic and added the private method getDeltaSyncFilter()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: Add configuration property to optimize AD/LDAP delta sync search filters
Description:
Currently, Ranger Usersync uses an OR conditional query containing both modifyTimeStamp and uSNChanged attributes to detect changes during delta syncs. According to customer feedback, executing a search query with both attributes combined negatively affects Active Directory (AD) performance. At present, this behavior is hardcoded by design and cannot be configured to use only the environment-specific attribute (such as uSNChanged for AD).
Changes:
Introduced a new configuration property (e.g., ranger.usersync.ldap.deltasync.servertype) to allow administrators to specify the directory server type and optimize the search query:
When set to ad: The delta sync query uses only the uSNChanged attribute.
When set to ldap: The delta sync query uses only the modifyTimestamp attribute.
When empty or unset: Falls back to the existing OR-combined filter to ensure backward compatibility.
Impact:
Improves Active Directory search performance and reduces query overhead by eliminating complex OR conditions and avoiding unsupported attribute queries. There is no behavioral change or impact on existing deployments unless the new property is explicitly configured.
Testing:
Verified delta sync works correctly against Active Directory when the property is configured as ad.
Verified delta sync works correctly against OpenLDAP when the property is configured as ldap.
Verified legacy backward compatibility behaves as expected (using the OR conditional) when the property is not configured.
Tested the performance by synchronizing ~1.14 million users. With the optimized ad configuration, the sync process completed 1 minute faster compared to the default OR-combined filter.