Skip to content

KAFKA-20110 Fix DynamicQuotaConfig#21384

Open
see-quick wants to merge 2 commits intoapache:trunkfrom
see-quick:KAFKA-20110
Open

KAFKA-20110 Fix DynamicQuotaConfig#21384
see-quick wants to merge 2 commits intoapache:trunkfrom
see-quick:KAFKA-20110

Conversation

@see-quick
Copy link
Contributor

This PR fixes a problem with a few broker properties. More can be found https://issues.apache.org/jira/browse/KAFKA-20110.

Signed-off-by: see-quick <maros.orsak159@gmail.com>
@github-actions github-actions bot added the triage PRs from the community label Feb 2, 2026
@see-quick see-quick changed the title [KAFKA-20110] Fix DynamicQuotaConfig KAFKA-20110 Fix DynamicQuotaConfig Feb 2, 2026
@github-actions github-actions bot added core Kafka Broker small Small PRs labels Feb 2, 2026
@chia7712
Copy link
Member

chia7712 commented Feb 2, 2026

is this duplicate to #21131?

@see-quick
Copy link
Contributor Author

see-quick commented Feb 2, 2026

is this duplicate to #21131?

Hmmm, partially (as it fixes the isReadOnly)? However, my PR also adds to PER_BROKER_CONFIGS and AbstractKafkaConfig.CONFIG_DEFto display it on the Kafka site within the broker [1] (currently it's not there).

Does #21131 fix the website issue? 🤔

[1] - https://kafka.apache.org/41/configuration/

.define(QuotaConfig.REPLICA_ALTER_LOG_DIRS_IO_MAX_BYTES_PER_SECOND_CONFIG, ConfigDef.Type.LONG,
QuotaConfig.QUOTA_BYTES_PER_SECOND_DEFAULT, ConfigDef.Range.atLeast(0),
ConfigDef.Importance.MEDIUM, QuotaConfig.REPLICA_ALTER_LOG_DIRS_IO_MAX_BYTES_PER_SECOND_DOC);
return BROKER_QUOTA_CONFIG_DEF;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new ConfigDef is required for each call because the one from brokerQuotaConfigs is subject to modification

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think problem is more deeper ... In the, we can see

ConfigDef configs = QuotaConfig.brokerQuotaConfigs();
// Filter and define all dynamic configurations
AbstractKafkaConfig.CONFIG_DEF.configKeys().forEach((name, value) -> {
if (DynamicBrokerConfig.ALL_DYNAMIC_CONFIGS.contains(name)) {
configs.define(value);
}
});
BROKER_CONFIGS = configs;

I don't why there is QuotaConfig.brokerQuotaConfigs(); as other configs is loaded from ALL_DYNAMIC_CONFIGS. Maybe that's because someone forgot to include it inside the ALL_DYNAMIC_CONFIGS backthen...

Anyway, I have removed/replaced ConfigDef configs = QuotaConfig.brokerQuotaConfigs() as it is already included and defined in the ALL_DYNAMIC_CONFIGS, and it seems to work. Also checked the website and showing the right values.

Let me know what you think.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe that's because someone forgot to include it inside the ALL_DYNAMIC_CONFIGS backthen...

yes, that's indeed an issue, and #21131 tries to fix it :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but still this line of code.

ConfigDef configs = QuotaConfig.brokerQuotaConfigs();

I don't get why we have just 3 properties, which are configured only dynamically. Why not also dual-mode (i.e., static || dynamic)? Like for instance num.io.threads works fine in dual-mode but probably I should read a KIP, which introduced those properties... but it's bit weird.

At least I think we should add comment here that in such line DynamicConfig.java#L36 those configs are dynamic-only and not dual-mode as others.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get why we have just 3 properties, which are configured only dynamically. Why not also dual-mode (i.e., static || dynamic)? Like for instance num.io.threads works fine in dual-mode but probably I should read a KIP, which introduced those properties... but it's bit weird.

You might want to check out the KIP-1051, which address the exact issue

At least I think we should add comment here that in such line DynamicConfig.java#L36 those configs are dynamic-only and not dual-mode as others.

Actually, the comment is already there. see https://github.com/apache/kafka/blob/trunk/server/src/main/java/org/apache/kafka/server/config/DynamicConfig.java#L27

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to check out the KIP-1051, which address the exact issue

So it's still under-discussion? I am bit a lost in the JIRAs like there is always at least one JIRA for issue I found :D . Because that KIP just wants to move such configuration from DynamicConfig to KafkaConfig which is not a case.

Actually, the comment is already there. see https://github.com/apache/kafka/blob/trunk/server/src/main/java/org/apache/kafka/server/config/DynamicConfig.java#L27

Class used to hold dynamic configs. These are configs which have no physical manifestation in the server.properties and can only be set dynamically.

used to (past)? It's still holding dynamic-only configs (i.e., QuotaConfig.brokerQuotaConfigs();)? And then you have also dual-mode configs which are filtered from the AbstractKafkaConfig i.e., :

// Filter and define all dynamic configurations
            AbstractKafkaConfig.CONFIG_DEF.configKeys().forEach((name, value) -> {
                if (DynamicBrokerConfig.ALL_DYNAMIC_CONFIGS.contains(name)) {
                    configs.define(value);
                }
            });

I would probably fix that doc something like:

Holds dynamic configs, including both dynamic-only configs (e.g., quotas)                                                                                                                                                           
and dual-mode configs that can be set statically or dynamically.    

I think it would help with overall understanding.

@github-actions github-actions bot removed the triage PRs from the community label Feb 5, 2026
Signed-off-by: see-quick <maros.orsak159@gmail.com>
QuorumConfig.CONFIG_DEF,
MetricConfigs.CONFIG_DEF,
QuotaConfig.CONFIG_DEF,
QuotaConfig.BROKER_QUOTA_CONFIG_DEF,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should not be added to AbstractKafkaConfig.CONFIG_DEF, as they cannot be set in server.properties

see https://issues.apache.org/jira/browse/KAFKA-20125

Copy link
Contributor Author

@see-quick see-quick Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so basically if I get it right. If property can't be configured in server.properties (i.e., static broker configs). For some dynamic-only (i.e., leader.replication.throttled.rate ... ) configs they won't be in the section [1]? So that's basically correct?

[1] - https://kafka.apache.org/41/configuration/broker-configs/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @showuon. If my assumption is right.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they won't be in the section [1]? So that's basically correct?

I think it's still beneficial to document them. The updates in KAFKA-20125 will remind users that these configs are dynamic-only. We could modify the config generation logic instead of adding them to AbstractKafkaConfig.CONFIG_DEF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved core Kafka Broker small Small PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants