KAFKA-19026: AlterConfigPolicy incompatibility between ZK mode and KR…
…aft mode when using AlterConfigOp.OpType.SUBTRACT
Modified ZkAdminManager.scala so that on OpType.SUBTRACT the policy receives the modified configs, as happens in KRaft mode.
This similarly fixes the OpType.APPEND differences.
Note that the policy behavior on OpType.DELETE is different when altering Broker and Topic resources. For topics the policy does not see a map entry, for brokers the config value is null. This was the existing behavior for KRaft and this commit does not change that.
ClusterTest added.
Note that the inconsistent DELETE behavior between Topic and Broker resources is present in the KRaft mode and described by https://issues.apache.org/jira/browse/KAFKA-19028
@cmccabe @jsancio may you please take a look ? thanks
I'd love to have this fix in 3.9.1 ...
@showuon @frankvicky can we get this in 3.9.2 at least ?
@showuon would you like to give this PR a 2nd look ?
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.
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.
Hi i rebased on the current 3.9 branch and re-ran the test included in this PR
./gradlew core:test --tests AlterConfigPolicyConfigsTest
the test fails for ZK mode without the fix
IMHO, the failed tests in the CI Jenkins run are not related to this PR
Hi @edoardocomar, after discussing with @chia7712, we think that this is kind of behavior change in ZK mode. It’s not ideal to include such a change in a patch release like 3.9.2. I know we already added documentation about this in 3.9.1, which mentions the known issue https://issues.apache.org/jira/browse/KAFKA-19026. How about we enhance that document by adding a clear example and summarizing the conclusion we’ve reached here?
The reason I developed this fix - which I have applied to all our kafka clusters in ZK mode, and has been running for many months is that it allows to plug in a simple AlterConfigPolicy that disallows clearing a topic's cleanup.policy.
If a topic has an empty cleanup.policy, Kafka will allow it to grow forever.
This in my opinion is an extremely important AlterConfigPolicy that the admin of a Kafka cluster should implement. I don't think keeping backward compatibility in such a narrow field should prevail over correctness of behavior.
I am not interested to over document the issue. The release note was good enough for 3.9.1. Now it's a chance to get this fixed
@ijuma do you have any suggestion for this PR? ZK's AlterConfigPolicy behavior is long-standing. Do we really want to change it in 3.9.2 to match KRaft?
I create a discussion thread for this in dev channel.
https://lists.apache.org/thread/bknho1vrvby1tpq634g744vqf4mr8coh