Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
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.