kafka
kafka copied to clipboard
KAFKA-14214: Convert StandardAuthorizer to copy-on-write
Convert StandardAuthorizer to use a copy-on-write sorted array rather than a ConcurrentSkipList. The issue with the skiplist was that because it was modified while in use by StandardAuthorizer#authorize, we could sometimes expose an inconsistent state. For example, if we added a "deny principal foo", followed by "allow all", a request for principal foo might happen to see the second one, without seeing the first one, even though the first one was added first.
The sorted array data structure is more compact than the tree, although it has the disadvantage of needing to be copied every time it's modified. On the broker side, we can apply a batch of updates atomically now. On the controller side, we still apply updates one-by-one, for now.
This PR renames AclAuthorizerBenchmark to AuthorizerBenchmark and extends it to report information about StandardAuthorizer as well as AclAuthorizer.
Co-authored-by: Akhilesh Chaganti [email protected]
Jenkins went down again. :(
java.nio.file.FileSystemException: /home/jenkins/workspace/Kafka_kafka-pr_PR-12636: No space left on device
Thanks for the PR. @cmccabe can you please include the benchmark results before/after this change? Also, can we explain if there are any changes with regards to algorithmic complexity from the previous implementation to this one for authorize
and updateAcl
calls?
I uploaded a new version at https://github.com/apache/kafka/pull/12662
I uploaded a new version at https://github.com/apache/kafka/pull/12662
In that case, closing this one.