KAFKA-19460: Improve documentation of fetch.min.bytes and replica.fetch.min.bytes (#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 <xuze_yang@163.com>

Reviewers: Luke Chen <showuon@gmail.com>
This commit is contained in:
yangxuze 2025-07-14 12:57:15 +08:00 committed by GitHub
parent 986322dc36
commit b6fce13e3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -186,7 +186,7 @@ public class ConsumerConfig extends AbstractConfig {
*/ */
public static final String FETCH_MIN_BYTES_CONFIG = "fetch.min.bytes"; public static final String FETCH_MIN_BYTES_CONFIG = "fetch.min.bytes";
public static final int DEFAULT_FETCH_MIN_BYTES = 1; public static final int DEFAULT_FETCH_MIN_BYTES = 1;
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."; 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.";
/** /**
* <code>fetch.max.bytes</code> * <code>fetch.max.bytes</code>

View File

@ -70,7 +70,7 @@ public class ReplicationConfigs {
public static final String REPLICA_FETCH_MIN_BYTES_CONFIG = "replica.fetch.min.bytes"; public static final String REPLICA_FETCH_MIN_BYTES_CONFIG = "replica.fetch.min.bytes";
public static final int REPLICA_FETCH_MIN_BYTES_DEFAULT = 1; public static final int REPLICA_FETCH_MIN_BYTES_DEFAULT = 1;
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)."; 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";
public static final String REPLICA_FETCH_BACKOFF_MS_CONFIG = "replica.fetch.backoff.ms"; public static final String REPLICA_FETCH_BACKOFF_MS_CONFIG = "replica.fetch.backoff.ms";
public static final int REPLICA_FETCH_BACKOFF_MS_DEFAULT = 1000; public static final int REPLICA_FETCH_BACKOFF_MS_DEFAULT = 1000;