KAFKA-13859: Disable idempotence on SCRAM authentication#12105
KAFKA-13859: Disable idempotence on SCRAM authentication#12105dengziming wants to merge 1 commit intoapache:trunkfrom
Conversation
|
Hello @showuon @ijuma @hachikuji , This problem is similar to what we fixed in #11788, however, it's more subtle. And I'm not sure whether we should try a different approach, what's your thought? |
|
@dengziming , thanks for the quick investigation! Nice finding! Yes, once idempotent producer is enabled, the transactionManager will be created. And in Sender run loop here, we'll try to create the producer ID with But my question will be, could we, on the other hand, fix the issue in the server side, to skip the transaction ID permission check if transaction ID is Also, we might test cases for it. You could refer to the test: Great find again! Thank you! |
|
@dengziming , have a 2nd look, I found it's not right. Here, we won't check the transactional_ID write permission Does that mean the user doesn't have |
|
@showuon Yeah, you are right, Here is the log of clients when I reproduce this error with the 3.0.1 client, it shows we are failing the |
|
Thanks @dengziming . I checked the KIP-679 and found this:
Could you help check if we only need |
It seems this is what I met here, a 3.0.1 client send to a 2.X broker will fail with ClusterAuthorizationException, this is not a bug according to KIP-679 but an intentional change. |
|
Close this since this is designed intentionally, we should help the users to make this change. |
|
Thanks @dengziming ! |
|
To be clear, the broker would have to be older than 2.8 for the issue to occur. The server change for KIP-679 happened in Apache Kafka 2.8. |
Yes, the user confirmed that their broker version is in v2.6.2 and client version is in v3.0.1. So, this is the expected behavior. Thanks @dengziming and @ijuma ! |
More detailed description of your change
After upgrading from 2.X to 3.0.1 we set "enable.idempotence"=true by default, but the
InitProducerIdRequestinvolves theTRANSACTIONAL_IDare authorized to write if we are using SCRAM authentication, or it will fail.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)