-
Notifications
You must be signed in to change notification settings - Fork 14.8k
KAFKA-18854:Move DynamicConfig to server module #19019
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
frankvicky
left a comment
There was a problem hiding this 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( |
There was a problem hiding this comment.
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?
chia7712
left a comment
There was a problem hiding this 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
frankvicky
left a comment
There was a problem hiding this 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
| 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()); | ||
| } | ||
| } |
There was a problem hiding this comment.
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);
}
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right
| Set<String> propKeys = new HashSet<>(); | ||
| for (Object key : props.keySet()) { | ||
| propKeys.add((String) key); | ||
| } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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);There was a problem hiding this comment.
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
|
@chia7712 PTAL |
| private[server] val DynamicProducerStateManagerConfig = Set(TransactionLogConfig.PRODUCER_ID_EXPIRATION_MS_CONFIG, TransactionLogConfig.TRANSACTION_PARTITION_VERIFICATION_ENABLE_CONFIG) | ||
|
|
||
| val AllDynamicConfigs = DynamicSecurityConfigs ++ | ||
| LogCleaner.ReconfigurableConfigs ++ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
|
it seems |
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>
|
This PR is being marked as stale since it has not had any activity in 90 days. If you 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. |
|
This PR has been closed since it has not had any activity in 120 days. If you feel like this |
move
dynamicConfigto server module.delete DynamicConfig.scala