Uploaded image for project: 'AMQ Streams'
  1. AMQ Streams
  2. ENTMQST-1709

Fix issues in Quota management in the User Operator

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 1.4.0.GA
    • 1.4.0.GA
    • None
    • None
    • 1

      The Quota management in User Operator does not work. As reported by jstejska@redhat.com, any KafkaUser resource containing quotas ends up in following exception:

      [2020-03-06 19:20:27,136] ERROR <ractOperator:124> [oop-thread-1] Reconciliation #0(watch) User(user-cluster-test/arnost): createOrUpdate failed
      java.lang.NullPointerException: null
      	at java.util.Objects.requireNonNull(Objects.java:203) ~[?:1.8.0_242]
      	at java.util.Optional.<init>(Optional.java:96) ~[?:1.8.0_242]
      	at java.util.Optional.of(Optional.java:108) ~[?:1.8.0_242]
      	at io.strimzi.operator.common.operator.resource.ReconcileResult$Patched.<init>(ReconcileResult.java:45) ~[io.strimzi.operator-common-0.18.0-SNAPSHOT.jar:0.18.0-SNAPSHOT]
      	at io.strimzi.operator.common.operator.resource.ReconcileResult$Patched.<init>(ReconcileResult.java:42) ~[io.strimzi.operator-common-0.18.0-SNAPSHOT.jar:0.18.0-SNAPSHOT]
      	at io.strimzi.operator.common.operator.resource.ReconcileResult.patched(ReconcileResult.java:61) ~[io.strimzi.operator-common-0.18.0-SNAPSHOT.jar:0.18.0-SNAPSHOT]
      	at io.strimzi.operator.user.operator.KafkaUserQuotasOperator.lambda$reconcile$0(KafkaUserQuotasOperator.java:47) ~[io.strimzi.user-operator-0.18.0-SNAPSHOT.jar:0.18.0-SNAPSHOT]
      	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:316) ~[io.vertx.vertx-core-3.8.5.jar:3.8.5]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_242]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_242]
      	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [io.netty.netty-common-4.1.45.Final.jar:4.1.45.Final]
      	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
      

      I believe this is because of insuficient test coverage which doesn't at all test the reconcile method combined with the changes in Strimzi#2525.

      Additionally, I found two more bugs:

      • When only one field from the quotas section is removed and others remain, it is not removed from Zookeeper
      • Quotas are basically ignored with SCRAM-SHA-512 users because the Quota operator and ScramSha operator run in parallel bu modify the same Zoo path /config/users/<username. They basically overwrite each others record in Zoo.

            Unassigned Unassigned
            scholzj JAkub Scholz
            Jakub Stejskal Jakub Stejskal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: