Skip to content

Conversation

@gongxuanzhang
Copy link
Contributor

@gongxuanzhang gongxuanzhang commented Feb 24, 2025

move dynamicConfig to server module.
delete DynamicConfig.scala

@github-actions github-actions bot added triage PRs from the community core Kafka Broker storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature transactions Transactions and EOS clients labels Feb 24, 2025
Copy link
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

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

Hi @gongxuanzhang
Thanks for the patch.
Could you please fix the build error?
I could pass build without test on my local, so you may need to do further check in your environment.

// This indicates whether unreleased MetadataVersions should be enabled on this node.
.defineInternal(UNSTABLE_FEATURE_VERSIONS_ENABLE_CONFIG, BOOLEAN, false, HIGH);

public static final Set<String> RECONFIGURABLE_CONFIGS = Set.of(
Copy link
Member

Choose a reason for hiding this comment

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

Could you please move it to DynamicConfig?

@github-actions github-actions bot removed the triage PRs from the community label Feb 25, 2025
Copy link
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

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

@gongxuanzhang please remove DynamicConfig.scala from this PR

Copy link
Contributor

@frankvicky frankvicky left a comment

Choose a reason for hiding this comment

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

Thanks for the patch.
I have left some comments. PTAL

Comment on lines 74 to 80
for (Map.Entry<String, ConfigDef.ConfigKey> entry :
AbstractKafkaConfig.CONFIG_DEF.configKeys().entrySet()) {
String configName = entry.getKey();
if (ALL_DYNAMIC_CONFIGS.contains(configName)) {
configs.define(entry.getValue());
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

            AbstractKafkaConfig.CONFIG_DEF.configKeys().forEach((configName, value) -> {
                if (ALL_DYNAMIC_CONFIGS.contains(configName)) {
                    configs.define(value);
                }
            });

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 are right

Comment on lines +178 to +181
Set<String> propKeys = new HashSet<>();
for (Object key : props.keySet()) {
propKeys.add((String) key);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this block can move into the if condition?

Copy link
Contributor

Choose a reason for hiding this comment

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

something like:

        if (!customPropsAllowed) {
            Set<String> names = configDef.names();
            Set<String> propKeys = new HashSet<>();
            for (Object key : props.keySet()) {
                propKeys.add((String) key);
            }
            Set<String> unknownKeys = new HashSet<>(propKeys);
            unknownKeys.removeAll(names);
            if (!unknownKeys.isEmpty()) {
                throw new IllegalArgumentException("Unknown Dynamic Configuration: " + unknownKeys);
            }
        }
        Properties propResolved = resolveVariableConfigs(props);
        // Validate Values
        return configDef.parse(propResolved);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the original scala code, this code was cast.I wrote that on purpose

@gongxuanzhang
Copy link
Contributor Author

@chia7712 PTAL

private[server] val DynamicProducerStateManagerConfig = Set(TransactionLogConfig.PRODUCER_ID_EXPIRATION_MS_CONFIG, TransactionLogConfig.TRANSACTION_PARTITION_VERIFICATION_ENABLE_CONFIG)

val AllDynamicConfigs = DynamicSecurityConfigs ++
LogCleaner.ReconfigurableConfigs ++
Copy link
Member

Choose a reason for hiding this comment

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

Could you please move ReconfigurableConfigs to CleanerConfig?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chia7712 PTAL

public static final String SASL_OAUTHBEARER_HEADER_URLENCODE_DOC = "The (optional) setting to enable the OAuth client to URL-encode the client_id and client_secret in the authorization header"
+ " in accordance with RFC6749, see <a href=\"https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1\">here</a> for more details. The default value is set to 'false' for backward compatibility";

public static final Set<String> RECONFIGURABLE_CONFIGS = Set.of(
Copy link
Member

Choose a reason for hiding this comment

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

SaslConfigs.java is public, so maybe we can move this set to DynamicConfig?

SslConfigs.SSL_KEYSTORE_KEY_CONFIG,
SslConfigs.SSL_TRUSTSTORE_CERTIFICATES_CONFIG);

public static final Set<String> DYNAMIC_LISTENER_CONFIGS = Set.of(
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@chia7712
Copy link
Member

chia7712 commented Mar 2, 2025

it seems AllDynamicConfigs causes trouble on migration. Maybe we should move other "small" dynamic classes first

chia7712 pushed a commit that referenced this pull request Apr 20, 2025
This PR is a umbrella of [KAFKA-18854.
](https://issues.apache.org/jira/browse/KAFKA-18854)

The previous PR encountered some compatibility issues, so we decided to
split it and proceed with the migration step by step.

see #19019

Reviewers: PoAn Yang <payang@apache.org>, Chia-Ping Tsai
 <chia7712@gmail.com>
@github-actions
Copy link

github-actions bot commented Jun 4, 2025

This PR is being marked as stale since it has not had any activity in 90 days. If you
would like to keep this PR alive, please leave a comment asking for a review. If the PR has
merge conflicts, update it with the latest from the base branch.

If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact).

If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.

@github-actions github-actions bot added the stale Stale PRs label Jun 4, 2025
@github-actions
Copy link

github-actions bot commented Jul 4, 2025

This PR has been closed since it has not had any activity in 120 days. If you feel like this
was a mistake, or you would like to continue working on it, please feel free to re-open the
PR and ask for a review.

@github-actions github-actions bot added the closed-stale PRs that were closed due to inactivity label Jul 4, 2025
@github-actions github-actions bot closed this Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved clients closed-stale PRs that were closed due to inactivity core Kafka Broker stale Stale PRs storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature transactions Transactions and EOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants