ableegoldman commented on a change in pull request #10573:
URL: https://github.com/apache/kafka/pull/10573#discussion_r630552512



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
##########
@@ -525,6 +525,11 @@ private TransactionManager 
configureTransactionState(ProducerConfig config,
             final int transactionTimeoutMs = 
config.getInt(ProducerConfig.TRANSACTION_TIMEOUT_CONFIG);
             final long retryBackoffMs = 
config.getLong(ProducerConfig.RETRY_BACKOFF_MS_CONFIG);
             final boolean autoDowngradeTxnCommit = 
config.getBoolean(ProducerConfig.AUTO_DOWNGRADE_TXN_COMMIT);
+            // Only log a warning if being used outside of Streams, which we 
know includes "StreamThread-" in the client id
+            if (autoDowngradeTxnCommit && !clientId.contains("StreamThread-")) 
{

Review comment:
       @ijuma I came across this after the question was raised around the 
autodowngrade logic, apparently (according to the config's javadocs) it's an 
"internal" config that's only used for Streams. The config itself is 
package-private.
   
   Given that, I thought we may want to log a warning to any plain client users 
that saw this config and didn't notice that it was internal, and thus tried to 
use it. But I'm happy to do a followup PR to remove this. Alternatively, we can 
just take this config out -- I actually don't see any reason why it should be 
necessary, AFAICT it's just a slight convenience config that saves Streams from 
the ~5 lines of code it would take to do this downgrade itself (basically it 
just erases the extra consumer group metadata that isn't understood by older 
brokers). Not sure if this was vestigial from an older iteration of KIP-447, as 
it seems rather unnecessary..




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to