Skip to content

RANGER-5466 Avoid hardcoded delta sync and unnecessary LDAP filter when delta sync is disabled - #827

Merged
pradeepagrawal8184 merged 3 commits into
apache:masterfrom
kimsehwan96:RANGER-5466
Sep 1, 2026
Merged

pradeepagrawal8184 merged 3 commits into
apache:masterfrom
kimsehwan96:RANGER-5466

Conversation

@kimsehwan96

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  1. setup.py: Changed hardcoded ranger.usersync.ldap.deltasync=true to only set the default value when the property is not already configured in install.properties.

  2. LdapUserGroupBuilder: Skip appending delta sync filter conditions (uSNChanged, modifyTimestamp) to LDAP search queries when delta sync is disabled. Applied to both getUsers() and getGroups()

Some LDAP services (e.g., Google Workspace Secure LDAP) do not support the attributes used for delta sync (uSNChanged, modifyTimestamp), which causes delta sync to not work properly. In such cases, users should be able to disable delta sync and run full sync without unnecessary filter conditions being included in the LDAP queries.

How was this patch tested?

  • Built locally and verified LDAP search filters with delta sync enabled and disabled

@pradeepagrawal8184

Copy link
Copy Markdown
Contributor

Seems there are tests failures:
[ERROR] Failures:
[ERROR] TestLdapUserGroupBuilder.testW_getGroups_processes_groups_and_memberships:647 (&(objectclass=groupOfNames)(cn=*)): must contain 'modifyTimestamp>=' ==> expected: but was:
[INFO]
[ERROR] Tests run: 99, Failures: 1, Errors: 0, Skipped: 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change, can you please update this if condition to if (config.isDeltaSyncEnabled() && (computeDeletes)) ? That way it is much easier to understand the code. In case of delta sync not enabled, anyway we are performing full sync all the time and not using deltaSyncGroupTime or deltaSyncGroupTimeStamp in the filter.

@kimsehwan96 kimsehwan96 Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change, can you please update this if condition to
if (!groupUserTable.rowKeySet().isEmpty() || (config.isDeltaSyncEnabled() && (computeDeletes)))
? That way it is much easier to understand the code. In case of delta sync not enabled, anyway we are performing full sync all the time and not using deltaSyncGroupTime or deltaSyncGroupTimeStamp in the filter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kimsehwan96

kimsehwan96 commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Seems there are tests failures: [ERROR] Failures: [ERROR] TestLdapUserGroupBuilder.testW_getGroups_processes_groups_and_memberships:647 (&(objectclass=groupOfNames)(cn=*)): must contain 'modifyTimestamp>=' ==> expected: but was: [INFO] [ERROR] Tests run: 99, Failures: 1, Errors: 0, Skipped: 2

@pradeepagrawal8184
That test was relying on the delta filter being appended even with delta sync off. I fixed it in 74e6409
(also added more tests related with this PR changes)

@pradeepagrawal8184
pradeepagrawal8184 merged commit 5053fa0 into apache:master Sep 1, 2026
4 checks passed
vyommani pushed a commit to vyommani/ranger that referenced this pull request Sep 10, 2026
…en delta sync is disabled (apache#827)

* RANGER-5466 Avoid hardcoded delta sync and unnecessary LDAP filter when delta sync is disabled

* RANGER-5466 Update ugsync tests for conditional delta sync filter

* RANGER-5466 Simplify delta sync reset conditions per review
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants