lh0156 commented on code in PR #22937:
URL: https://github.com/apache/kafka/pull/22937#discussion_r3701835570


##########
clients/src/main/java/org/apache/kafka/common/config/TopicConfig.java:
##########
@@ -199,7 +199,13 @@ public class TopicConfig {
     public static final String UNCLEAN_LEADER_ELECTION_ENABLE_CONFIG = 
"unclean.leader.election.enable";
     public static final String UNCLEAN_LEADER_ELECTION_ENABLE_DOC = "Indicates 
whether to enable replicas " +
         "not in the ISR set to be elected as leader as a last resort, even 
though doing so may result in data " +
-        "loss.<p>Note: In KRaft mode, when enabling this config dynamically, 
it needs to wait for the unclean leader election" +
+        "loss. Enabling this configuration for a topic that uses transactions 
is incompatible with exactly-once " +
+        "semantics. An unclean election can remove a transaction's COMMIT or 
ABORT marker from the elected replica, " +
+        "causing consumers with <code>isolation.level=read_committed</code> to 
stop at the last stable offset. " +
+        "If this occurs, use <code>kafka-transactions.sh find-hanging</code> 
to identify the affected transaction and " +
+        "<code>kafka-transactions.sh abort</code> to recover it. Verify the 
transaction and partition before aborting " +
+        "it, since an unclean election may already have caused data loss." +
+        "<p>Note: In KRaft mode, when enabling this config dynamically, it 
needs to wait for the unclean leader election " +

Review Comment:
   Thanks, I agree that an end-to-end unclean-election test would be valuable. 
I kept this PR documentation-only because a reliable test would need to control 
the election race, reproduce a missing transaction marker, and verify the 
read_committed behavior; that is a broader and timing-sensitive integration 
test rather than validation of the documentation change. I would be happy to 
address that as a separate follow-up if the maintainers want it.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to