ahuang98 commented on code in PR #21028:
URL: https://github.com/apache/kafka/pull/21028#discussion_r2666526106
##########
raft/src/main/java/org/apache/kafka/raft/internals/KafkaRaftLog.java:
##########
@@ -118,14 +118,22 @@ UnifiedLog log() {
}
@Override
- public LogFetchInfo read(long startOffset, Isolation readIsolation) {
+ public int defaultMaxTotalRecordsSizeBytes() {
+ return config.internalMaxFetchSizeInBytes();
+ }
+
+ @Override
+ public LogFetchInfo read(long startOffset, Isolation readIsolation, int
maxRecordSizeBytes) {
FetchIsolation isolation = switch (readIsolation) {
case COMMITTED -> FetchIsolation.HIGH_WATERMARK;
case UNCOMMITTED -> FetchIsolation.LOG_END;
};
try {
- FetchDataInfo fetchInfo = log.read(startOffset,
config.internalMaxFetchSizeInBytes(), isolation, true);
+ FetchDataInfo fetchInfo = log.read(startOffset,
+
defaultMaxTotalRecordsSizeBytes(),
Review Comment:
this uses the default instead of the maxRecordSizeBytes arg (we should make
sure this would have been caught by a test)
##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -1622,7 +1622,7 @@ private FetchResponseData tryCompleteFetchRequest(
final Records records;
if (validOffsetAndEpoch.kind() == ValidOffsetAndEpoch.Kind.VALID) {
- LogFetchInfo info = log.read(fetchOffset,
Isolation.UNCOMMITTED);
+ LogFetchInfo info = log.read(fetchOffset,
Isolation.UNCOMMITTED, quorumConfig.fetchMaxSizeBytes());
Review Comment:
> the quorum member initiating the fetch/fetchsnapshot request will decide
how much information it desires and the receiving active-controller will
respect that wish
hm, from your PR description I would have expected the active controller to
read the request to see how many bytes it should return (not for the active
controller to read the quorumconfig itself)
--
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]