Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9980

Fix bug where alterClientQuotas could not set default client quotas

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6.0
    • Fix Version/s: 2.6.0
    • Component/s: None
    • Labels:
      None

      Description

      quota_tests.py is failing. Specifically for this test:

      [INFO:2020-05-11 19:22:47,493]: RunnerClient: Loading test {'directory': '/opt/kafka-dev/tests/kafkatest/tests/client', 'file_name': 'quota_test.py', 'method_name': 'test_quota', 'cls_name': 'QuotaTest', 'injected_args': {'quota_type': 'client-id', 'override_quota': False}}

       

      I log into the docker container and do

       

      /opt/kafka-dev/bin/kafka-configs.sh --bootstrap-server ducker03:9093 --describe --entity-type clients --command-config /opt/kafka-dev/bin/hi.properties

       

      and the command return

       

      Configs for the default client-id are consumer_byte_rate=2000000.0, producer_byte_rate=2500000.0
      Configs for client-id 'overridden_id' are consumer_byte_rate=1.0E9, producer_byte_rate=1.0E9
      Seems like the config is properly but the quota is not effective
       

      For investigation, I added a logging at 

      AdminZKClient.changeConfigs()

       

       

      def changeConfigs(entityType: String, entityName: String, configs: Properties): Unit =

      Unknown macro: {         warn(s"entityType = $entityType entityName = $entityName configs = $configs") ... }

      And use --bootstrap-server and --zookeeper to --alter the default client quota. I got

       

      Alter with --zookeeper:WARN entityType = clients entityName = <default> configs = {producer_byte_rate=1000000000, consumer_byte_rate=1000000000} (kafka.zk.AdminZkClient)

       

      and

       

      Alter with --bootstrap-server:WARN entityType = clients entityName = %3Cdefault%3E configs = {producer_byte_rate=1000000000, consumer_byte_rate=1000000000} (kafka.zk.AdminZkClient)

       

      I guess the encoding difference might cause the issue. The encoding happens in

       

      Sanitizer.sanitize()

        Attachments

          Activity

            People

            • Assignee:
              bbyrne Brian Byrne
              Reporter:
              d8tltanc Cheng Tan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: