Skip to content

Commit b6fce13

Browse files
authored
KAFKA-19460: Improve documentation of fetch.min.bytes and replica.fetch.min.bytes (apache#20111)
While walking through the source code I confirmed that the broker checks `replica.fetch.min.bytes` exactly the same way it checks `fetch.min.bytes`, so this patch updates the wording for both config keys. Co-authored-by: yangxuze <[email protected]> Reviewers: Luke Chen <[email protected]>
1 parent 986322d commit b6fce13

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public class ConsumerConfig extends AbstractConfig {
186186
*/
187187
public static final String FETCH_MIN_BYTES_CONFIG = "fetch.min.bytes";
188188
public static final int DEFAULT_FETCH_MIN_BYTES = 1;
189-
private static final String FETCH_MIN_BYTES_DOC = "The minimum amount of data the server should return for a fetch request. If insufficient data is available the request will wait for that much data to accumulate before answering the request. The default setting of " + DEFAULT_FETCH_MIN_BYTES + " byte means that fetch requests are answered as soon as that many byte(s) of data is available or the fetch request times out waiting for data to arrive. Setting this to a larger value will cause the server to wait for larger amounts of data to accumulate which can improve server throughput a bit at the cost of some additional latency.";
189+
private static final String FETCH_MIN_BYTES_DOC = "The minimum amount of data the server should return for a fetch request. If insufficient data is available the request will wait for that much data to accumulate before answering the request. The default setting of " + DEFAULT_FETCH_MIN_BYTES + " byte means that fetch requests are answered as soon as that many byte(s) of data is available or the fetch request times out waiting for data to arrive. Setting this to a larger value will cause the server to wait for larger amounts of data to accumulate which can improve server throughput a bit at the cost of some additional latency. Even if the total data available in the broker exceeds fetch.min.bytes, the actual returned size may still be less than this value due to per-partition limits max.partition.fetch.bytes and max returned limits fetch.max.bytes.";
190190

191191
/**
192192
* <code>fetch.max.bytes</code>

server/src/main/java/org/apache/kafka/server/config/ReplicationConfigs.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class ReplicationConfigs {
7070

7171
public static final String REPLICA_FETCH_MIN_BYTES_CONFIG = "replica.fetch.min.bytes";
7272
public static final int REPLICA_FETCH_MIN_BYTES_DEFAULT = 1;
73-
public static final String REPLICA_FETCH_MIN_BYTES_DOC = "Minimum bytes expected for each fetch response. If not enough bytes, wait up to <code>replica.fetch.wait.max.ms</code> (broker config).";
73+
public static final String REPLICA_FETCH_MIN_BYTES_DOC = "Minimum bytes expected for each fetch response. If not enough bytes, wait up to <code>replica.fetch.wait.max.ms</code> (broker config). Even if the total data available in the broker exceeds replica.fetch.min.bytes, the actual returned size may still be less than this value due to per-partition limits replica.fetch.max.bytes and max returned limits replica.fetch.response.max.bytes";
7474

7575
public static final String REPLICA_FETCH_BACKOFF_MS_CONFIG = "replica.fetch.backoff.ms";
7676
public static final int REPLICA_FETCH_BACKOFF_MS_DEFAULT = 1000;

0 commit comments

Comments
 (0)