Mahendra Korepu created RANGER-2433:
---------------------------------------
Summary: Ranger base plugin `grant-<timestamp>` (the
auto-generated grant name) may not be unique enough - Failing concurrent
transactions
Key: RANGER-2433
URL: https://issues.apache.org/jira/browse/RANGER-2433
Project: Ranger
Issue Type: Bug
Components: plugins
Reporter: Mahendra Korepu
When running concurrent grant transactions - Ranger base plugin returns
following error:
{code:java}
// 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
{code}
Recommendation : some sort of unique number or string need to be appended to
policy to avoid race conditions.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)