Managing delta sync for Ranger policies

Enabling delta sync allows component services to download only policy changes and update the policy engine incrementally, rather than rebuilding it completely from scratch every time a policy changes.

Delta sync significantly reduces compute rebuild time, minimizes network traffic between Ranger Admin and component services, and avoids frequent JVM garbage collection and compaction caused by excessive object churn.

The following configuration parameters control this feature:
Property Description Type Values
ranger.admin.supports.policy.deltas Controls whether the Ranger Admin server supports incremental policy updates. Boolean
  • True

    Supports incremental policy updates.

  • False

    Does not support incremental policy updates.

The default is false.

ranger.plugin.<service-type>.supports.policy.deltas Controls whether the service plugin supports incremental policy updates. Boolean
  • True

    Supports incremental policy updates.

  • False

    Does not support incremental policy updates.

The default is false.

By default, the properties are enabled. You can verify this by checking the Ranger Admin access log, where you can see supportsPolicyDeltas=false:
GET /service/plugins/secure/policies/download/<servicename>?supportsPolicyDeltas=false

Enable resource-based policy delta sync

You can enable resource-based policy delta sync for services by setting the following properties:
  1. Go to Cloudera Manager > Ranger > Configuration.
  2. Set the Ranger Admin Advanced Configuration Snippet (Safety Valve) for conf/ranger-admin-site.xml property as follows:
    Name: ranger.admin.supports.policy.deltas
    Value: true
  3. For all supported services, go to Cloudera Manager > <Service> > Configuration.
  4. Set the <Service> Service Advanced Configuration Snippet (Safety Valve) for ranger-<service-type>-security.xml property as follows:
    Name: ranger.plugin.<service-type>.supports.policy.deltas
    Value: true
  5. To confirm, you can check the logs in the Ranger Admin access log, where you can see supportsPolicyDeltas=true:
    GET /service/plugins/secure/policies/download/<servicename>?supportsPolicyDeltas=true

Enable tag-based policy delta sync

You can enable tag-based policy delta sync for services by setting the following properties:
  1. Go to Cloudera Manager > Ranger > Configuration.
  2. Set the Ranger Admin Advanced Configuration Snippet (Safety Valve) for conf/ranger-admin-site.xml property as follows:
    Name: ranger.admin.supports.policy.deltas
    Value: true
  3. For all supported services, go to Cloudera Manager > <Service> > Configuration.
  4. Set the <Service> Service Advanced Configuration Snippet (Safety Valve) for ranger-<service-type>-security.xml property as follows:
    Name: ranger.plugin.<service-type>.supports.tag.deltas
    Value: true
  5. To confirm, you can check the logs in the Ranger Admin access log, where you can see supportsTagDeltas=true:
    /service/tags/secure/download/cm_<service>?pluginId=<service>@<hostname>-<servicetype>&lastActivationTime=1656064926869&pluginCapabilities=3ffff&lastKnownVersion=4&supportsTagDeltas=true