You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "lh0156 (via GitHub)" <gi...@apache.org> on 2026/08/02 17:54:48 UTC

[PR] KAFKA-20866: Remove incremental-only append result state [kafka]

lh0156 opened a new pull request, #23032:
URL: https://github.com/apache/kafka/pull/23032

   ## Summary
   
   `RecordAppendResult` is created for every successful append. This change removes the incremental-strategy-only `outcome` and `extensionBytesNeeded` fields from regular results. Buffer-extension capacity is now held only by a private result subtype, while the existing append/new-batch behavior remains unchanged.
   
   The chunked accumulator consumes the capacity through a package-private accessor, and a regression test covers the buffer-extension result contract.
   
   ## Testing
   
   The implementation followed a TDD cycle:
   
   1. RED: the new regression test failed to compile because `extensionBytesNeeded()` did not exist.
   2. GREEN: implemented the result specialization and reran the test.
   
   Validated with:
   
   - `./gradlew :clients:test --tests org.apache.kafka.clients.producer.internals.RecordAccumulatorTest --tests org.apache.kafka.clients.producer.internals.ChunkedRecordAccumulatorTest --no-build-cache --console=plain`
   - `./gradlew :clients:test --no-build-cache --console=plain`
   - `./gradlew :clients:spotlessJavaCheck --no-build-cache --console=plain`
   
   The clients test task also ran checkstyle and SpotBugs successfully.


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20866: Remove incremental-only append result state [kafka]

Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on code in PR #23032:
URL: https://github.com/apache/kafka/pull/23032#discussion_r4047420697


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java:
##########
@@ -1290,46 +1290,27 @@ public PartitionerConfig() {
     }
 
     /*
-     * Result of an attempt to append a record to the accumulator. Carries exactly one of three
-     * mutually-exclusive outcomes: the record was appended ({@link RecordAppendResult#appended()}, {@code future} is set),
-     * the open batch needs more chunk capacity first ({@link RecordAppendResult#needsBufferExtension()}),
-     * or a new batch must be created for the record ({@link RecordAppendResult#needsNewBatch()}).
+     * Result of an attempt to append a record to the accumulator. A regular result represents
+     * either a successful append or a request to create a new batch. The incremental strategy
+     * uses a private subtype when an existing chunked batch needs more capacity.

Review Comment:
   with this we kind of lost the point that the result may have 3 mutually exclusive outcomes and what they are (the refs to funcs we had). 
   
   The comment as it was remains accurate right? what about keeping it as it was and just clarifying that the needsBufferExtension is incremental-only (changed on this PR)
   
   `....the open batch needs more chunk capacity first ({@link RecordAppendResult#needsBufferExtension()}, incremental only),....`
   



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20866: Remove incremental-only append result state [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23032:
URL: https://github.com/apache/kafka/pull/23032#issuecomment-5235602142

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20866: Remove incremental-only append result state [kafka]

Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on PR #23032:
URL: https://github.com/apache/kafka/pull/23032#issuecomment-5912927230

   Hello @lh0156 ! Would you be able to follow-up on this one? Thanks!


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20866: Remove incremental-only append result state [kafka]

Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on PR #23032:
URL: https://github.com/apache/kafka/pull/23032#issuecomment-6477460095

   Addressed with https://github.com/apache/kafka/pull/23749, thanks all!


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20866: Remove incremental-only append result state [kafka]

Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm closed pull request #23032: KAFKA-20866: Remove incremental-only append result state
URL: https://github.com/apache/kafka/pull/23032


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20866: Remove incremental-only append result state [kafka]

Posted by "Nikita-Shupletsov (via GitHub)" <gi...@apache.org>.
Nikita-Shupletsov commented on PR #23032:
URL: https://github.com/apache/kafka/pull/23032#issuecomment-5718156966

   There are conflicts, @lh0156 could you please update the PR?


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-20866: Remove incremental-only append result state [kafka]

Posted by "Nikita-Shupletsov (via GitHub)" <gi...@apache.org>.
Nikita-Shupletsov commented on PR #23032:
URL: https://github.com/apache/kafka/pull/23032#issuecomment-6074905152

   I prepared another PR: https://github.com/apache/kafka/pull/23749
   fixed the merge conflict and addressed the comment.
   @lianetm 


-- 
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-unsubscribe@kafka.apache.org

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