[
https://issues.apache.org/jira/browse/KAFKA-21433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18144278#comment-18144278
]
이선민 commented on KAFKA-21433:
-----------------------------
Hi [~chia7712], tagging you since you're working on KAFKA-20835, which is close
to this one.
KAFKA-20835 is about overrides that became invalid after the bounds were
narrowed. Here nothing changes after the override is set: the controller
validates it against its own group bounds and the broker clamps it against
different ones, so the override never takes effect as set. With a dedicated
controller on the default bounds (45000-60000) and a broker on 20000-30000,
45000 was accepted and immediately capped to 30000 on the broker, while 25000,
which the broker would accept, was rejected.
This may be relevant to the KIP you mentioned in KAFKA-20835. The direction
discussed there is to compare against effective values, but on a dedicated
controller those would be computed with the controller's bounds, which may not
be the ones the brokers apply.
Should the controller validate against the bounds the brokers use, or is
setting the same group bounds on controllers and brokers the expected setup,
which would make this mainly a documentation issue?
> Group config overrides are validated against the controller's group bounds
> but clamped against the broker's
> -----------------------------------------------------------------------------------------------------------
>
> Key: KAFKA-21433
> URL: https://issues.apache.org/jira/browse/KAFKA-21433
> Project: Kafka
> Issue Type: Bug
> Components: controller, group-coordinator
> Affects Versions: 4.3.0, 4.4.0
> Reporter: 이선민
> Priority: Minor
> Attachments: run.sh, summary.md
>
>
> When the controllers run as separate processes, an override set with
> kafka-configs.sh --entity-type groups is validated by the controller against
> the group bounds in the controller's own config, but it is clamped by the
> broker against the broker's bounds. If the two sets of bounds differ, an
> override can be clamped from the moment it is set. The reproduction below
> does not change any bounds after the override is set.
> The validation happens in ControllerConfigurationValidator
> (GroupConfig.validate with kafkaConfig.groupCoordinatorConfig).
> ControllerServer passes it sharedServer.brokerConfig, which SharedServer
> builds from the same process's properties as controllerConfig, so on a
> dedicated controller these are the controller's own group bounds. On the
> broker, GroupConfig clamps the override using the broker's
> GroupCoordinatorConfig bounds.
> I reproduced this on trunk at 601492157a. Code inspection of the 4.3.0 and
> 4.4.0 tags also shows controller-local bounds validation and broker-local
> clamping; I have not run the reproduction on those releases.
> *Reproduction* (trunk 601492157a, one controller and one broker, script
> attached)
> * Controller: no group.consumer.* settings, so the default bounds 45000 to
> 60000 apply.
> * Broker:
> {noformat}
> group.consumer.min.session.timeout.ms=20000
> group.consumer.session.timeout.ms=25000
> group.consumer.max.session.timeout.ms=30000
> {noformat}
> Results:
> # {{--alter --add-config consumer.session.timeout.ms=45000}} succeeded, and
> the broker logged right away:
> {noformat}
> The group config 'consumer.session.timeout.ms' for group 'g1' has value 45000
> which exceeds the broker's allowed maximum 30000. The effective value will be
> capped to 30000.
> {noformat}
> # DescribeConfigs returned 45000 (DYNAMIC_GROUP_CONFIG).
> # A consumer (group.protocol=consumer) was fenced for session expiry
> approximately 27.8 seconds after SIGKILL, consistent with the broker's logged
> effective timeout of 30000 ms.
> # 25000, which is inside the broker's bounds, was rejected:
> {noformat}
> consumer.session.timeout.ms must be in the range 45000 to 60000 inclusive.
> {noformat}
> With these configs, the two ranges do not overlap: every accepted override of
> consumer.session.timeout.ms is clamped by the broker, and every value within
> the broker's allowed range is rejected by the controller.
> The same validation path covers the other bounded group configs (share and
> streams as well), but I only reproduced it with consumer.session.timeout.ms.
> *Question*
> As far as I can see, the docs do not say that the group.* bounds must also be
> set on the controllers. Are operators expected to configure matching group
> bounds on controllers and brokers? If not, how should group override
> validation account for the bounds enforced by brokers?
> Found while investigating configured versus effective group values for
> KIP-1389 (KAFKA-20848). It is related to KAFKA-20835, which is about stale
> overrides after the bounds are narrowed; here the cause is that validation
> and clamping read their bounds from different processes.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)