You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "akash-gupta2813 (via GitHub)" <gi...@apache.org> on 2026/10/07 14:19:42 UTC
Re: [PR] RANGER-5820 : handle concurrent GRANT requests for ranger that are violating UK contraints. [ranger]
akash-gupta2813 commented on code in PR #1290:
URL: https://github.com/apache/ranger/pull/1290#discussion_r4208045084
##########
security-admin/src/main/java/org/apache/ranger/rest/ServiceRESTUtil.java:
##########
@@ -213,6 +214,82 @@ public static boolean processRevokeRequest(RangerPolicy existingRangerPolicy, Gr
return policyUpdated;
}
+ public static boolean isXPolicyUniqueConstraintViolation(Throwable excp) {
+ return isXPolicyServiceSignatureUniqueConstraintViolation(excp) || isXPolicyNameServiceZoneUniqueConstraintViolation(excp);
+ }
+
+ public static boolean isXPolicyServiceSignatureUniqueConstraintViolation(Throwable excp) {
+ boolean ret = false;
+ Throwable current = excp;
+
+ while (current != null && !ret) {
+ String message = current.getMessage();
+
+ if (StringUtils.containsIgnoreCase(message, "x_policy_UK_service_signature")) {
Review Comment:
have documented this
// Supported DBs include the violated constraint name in unique-key errors.
// Match only known x_policy constraints to avoid masking unrelated failures.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org