You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Andrew Grant (Jira)" <ji...@apache.org> on 2022/05/10 22:38:00 UTC

[jira] [Resolved] (KAFKA-13892) Dedupe RemoveAccessControlEntryRecord in deleteAcls of AclControlManager

     [ https://issues.apache.org/jira/browse/KAFKA-13892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Grant resolved KAFKA-13892.
----------------------------------
    Resolution: Fixed

> Dedupe RemoveAccessControlEntryRecord in deleteAcls of AclControlManager
> ------------------------------------------------------------------------
>
>                 Key: KAFKA-13892
>                 URL: https://issues.apache.org/jira/browse/KAFKA-13892
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Andrew Grant
>            Assignee: Andrew Grant
>            Priority: Major
>
> In [https://github.com/apache/kafka/blob/trunk/metadata/src/main/java/org/apache/kafka/controller/AclControlManager.java#L143] we loop through the ACL filters and and add RemoveAccessControlEntryRecord records to the response list for each matching ACL. I think there's a bug where if two filters match the same ACL, we create two RemoveAccessControlEntryRecord records for that same ACL. This is an issue because upon replay we throw an exception (https://github.com/apache/kafka/blob/trunk/metadata/src/main/java/org/apache/kafka/controller/AclControlManager.java#L195) if the ACL is not in the in-memory data structures which will happen to the second RemoveAccessControlEntryRecord.
> Maybe we can just de-dupe both List<AclDeleteResult> and List<ApiMessageAndVersion>? I think something like (just showing code for ApiMessageAndVersion):
> {code:java}
> private List<ApiMessageAndVersion> deDupeApiMessageAndVersion(List<ApiMessageAndVersion> messages) {
> return new HashSet<>(messages).stream().collect(Collectors.toList());
> }{code}
> should suffice as I don't think the ordering matters within the list of response objects.  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)