jolshan commented on code in PR #13608: URL: https://github.com/apache/kafka/pull/13608#discussion_r1205982602
########## storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateEntry.java: ########## @@ -41,18 +42,35 @@ public class ProducerStateEntry { private int coordinatorEpoch; private long lastTimestamp; private OptionalLong currentTxnFirstOffset; + + private VerificationState verificationState; + + // Before any batches are associated with the entry, the tentative sequence represents the lowest sequence seen. + private OptionalInt tentativeSequence; + + public enum VerificationState { + EMPTY, + VERIFYING, + VERIFIED + } Review Comment: I've addressed this issue by creating a verification object that is created on first attempt to verify and removed when a marker is written. When verification is needed, we pass this object through and check under log lock in the append path. In the steps above, 6 will clear this object, 7 will set a new one, so 8 will not succeed and error out. When verification is not needed (already verified), we rely on firstTxnOffset being present before appending to the log. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org