Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-2433

Ranger base plugin `grant-<timestamp>` (the auto-generated grant name) may not be unique enough - Failing concurrent transactions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • plugins
    • None

    Description

      When running concurrent grant transactions -  Ranger base plugin returns following error:

       

      // ERROR: InternalException: HTTP 400 Error: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
      Internal Exception: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "x_policy_uk_name_service_zone"
      Detail: Key (name, service, zone_id)=(grant-1557766372626, 4, 1) already exists.
      Error Code: 0
      Call: INSERT INTO x_policy (id, ADDED_BY_ID, CREATE_TIME, description, guid, is_audit_enabled, is_enabled, name, policy_options, policy_priority, policy_text, policy_type, resource_signature, service, UPDATE_TIME, UPD_BY_ID, version, zone_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      bind => [18 parameters bound]
      Query: InsertObjectQuery(XXPolicy [id=6438])
      Could not execute command: GRANT SELECT ON table db1.tbl1 TO GROUP usr_grp1
      Start, End, Duration: 20190513-095246/20190513-095252/6322.754
      

      Recommendation : some sort of unique number or string need to be appended to policy to avoid race conditions.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            korepum Mahendra Korepu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: