KAFKA-15853: Move TransactionLogConfig and TransactionStateManagerConfig getters out of KafkaConfig#16665
Conversation
|
It looks like this breaks a bunch of tests: |
6959e4b to
d643e8c
Compare
| .defineInternal(TransactionLogConfigs.PRODUCER_ID_EXPIRATION_CHECK_INTERVAL_MS_CONFIG, INT, TransactionLogConfigs.PRODUCER_ID_EXPIRATION_CHECK_INTERVAL_MS_DEFAULT, atLeast(1), LOW, TransactionLogConfigs.PRODUCER_ID_EXPIRATION_CHECK_INTERVAL_MS_DOC); | ||
| .defineInternal(PRODUCER_ID_EXPIRATION_CHECK_INTERVAL_MS_CONFIG, INT, PRODUCER_ID_EXPIRATION_CHECK_INTERVAL_MS_DEFAULT, atLeast(1), LOW, PRODUCER_ID_EXPIRATION_CHECK_INTERVAL_MS_DOC); | ||
|
|
||
| private AbstractConfig config; |
| } | ||
|
|
||
| public Boolean transactionPartitionVerificationEnable() { | ||
| return config.getBoolean(TRANSACTION_PARTITION_VERIFICATION_ENABLE_CONFIG); |
There was a problem hiding this comment.
could you please add comments to for those dynamic configs?
There was a problem hiding this comment.
Even with the comments, I'm not sure I understand why this is not initialized in the constructor.
Can you explain how this is supposed to work? AbstractConfig instances are kind of read only by default but it looks like we're expecting it to change here. Am I missing something?
There was a problem hiding this comment.
we had a discussion for that before (#16458 (comment))
AbstractConfig is read-only, but the sub class KafkaConfig can update inner configs dynamically (see https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/server/KafkaConfig.scala#L192). Hence, the passed AbstractConfig always have "up-to-date configs"
There is a jira which tries to refactor it (https://issues.apache.org/jira/browse/KAFKA-17001), but I haven't worked on it because that will introduce major changes to scala code.
In short, the basic rules for now are shown below.
- the non-dynamic config will be evaluated in constructor.
- the dynamic config will be evaluated in getter (as
AbstractConfigalways have latest configs)
| .define(TRANSACTIONS_ABORT_TIMED_OUT_TRANSACTION_CLEANUP_INTERVAL_MS_CONFIG, INT, TRANSACTIONS_ABORT_TIMED_OUT_TRANSACTION_CLEANUP_INTERVAL_MS_DEFAULT, atLeast(1), LOW, TRANSACTIONS_ABORT_TIMED_OUT_TRANSACTIONS_INTERVAL_MS_DOC) | ||
| .define(TRANSACTIONS_REMOVE_EXPIRED_TRANSACTIONAL_ID_CLEANUP_INTERVAL_MS_CONFIG, INT, TRANSACTIONS_REMOVE_EXPIRED_TRANSACTIONAL_ID_CLEANUP_INTERVAL_MS_DEFAULT, atLeast(1), LOW, TRANSACTIONS_REMOVE_EXPIRED_TRANSACTIONS_INTERVAL_MS_DOC); | ||
|
|
||
| private int transactionalIdExpirationMs; |
74a880a to
76d33d3
Compare
76d33d3 to
5a4d3d5
Compare
|
@OmniaGM I love this PR, but it includes too many files. Hence, I'd like to delay this PR until 3.9.0 gets release :) |
|
So is this the format we're going for? I see we have a constructor accepting I think it would be good to document the expected target and explain the pros and cons vs alternatives in the Jira. |
|
@OmniaGM could you please fix the conflicts? thanks! |
|
@OmniaGM Both |
They are called together only |
I have no strong reason to merge them though 😃 Let's keep current style. I will take another look later |
|
@OmniaGM Sorry that could you please fix the conflicts again? This PR will have highest priority in my queue |
…ig getters out of KafkaConfig (apache#16665) Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
…ig getters out of KafkaConfig (apache#16665) Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.
Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.
Committer Checklist (excluded from commit message)