18
18
package kafka .server
19
19
20
20
import org .apache .kafka .common .TopicPartition
21
- import org .apache .kafka .common .record .MemoryRecords
22
21
import org .apache .kafka .common .requests .FetchResponse
23
- import org .apache .kafka .server .common .{ MetadataVersion , OffsetAndEpoch }
22
+ import org .apache .kafka .server .common .OffsetAndEpoch
24
23
import org .apache .kafka .storage .internals .log .{LogAppendInfo , LogStartOffsetIncrementReason }
25
24
26
25
import java .util .Optional
@@ -32,8 +31,7 @@ class ReplicaFetcherThread(name: String,
32
31
failedPartitions : FailedPartitions ,
33
32
replicaMgr : ReplicaManager ,
34
33
quota : ReplicaQuota ,
35
- logPrefix : String ,
36
- metadataVersionSupplier : () => MetadataVersion )
34
+ logPrefix : String )
37
35
extends AbstractFetcherThread (name = name,
38
36
clientId = name,
39
37
leader = leader,
@@ -110,8 +108,6 @@ class ReplicaFetcherThread(name: String,
110
108
val log = partition.localLogOrException
111
109
val records = toMemoryRecords(FetchResponse .recordsOrFail(partitionData))
112
110
113
- maybeWarnIfOversizedRecords(records, topicPartition)
114
-
115
111
if (fetchOffset != log.logEndOffset)
116
112
throw new IllegalStateException (" Offset mismatch for partition %s: fetched offset = %d, log end offset = %d." .format(
117
113
topicPartition, fetchOffset, log.logEndOffset))
@@ -161,15 +157,6 @@ class ReplicaFetcherThread(name: String,
161
157
}
162
158
}
163
159
164
- private def maybeWarnIfOversizedRecords (records : MemoryRecords , topicPartition : TopicPartition ): Unit = {
165
- // oversized messages don't cause replication to fail from fetch request version 3 (KIP-74)
166
- if (metadataVersionSupplier().fetchRequestVersion <= 2 && records.sizeInBytes > 0 && records.validBytes <= 0 )
167
- error(s " Replication is failing due to a message that is greater than replica.fetch.max.bytes for partition $topicPartition. " +
168
- " This generally occurs when the max.message.bytes has been overridden to exceed this value and a suitably large " +
169
- " message has also been sent. To fix this problem increase replica.fetch.max.bytes in your broker config to be " +
170
- " equal or larger than your settings for max.message.bytes, both at a broker and topic level." )
171
- }
172
-
173
160
/**
174
161
* Truncate the log for each partition's epoch based on leader's returned epoch and offset.
175
162
* The logic for finding the truncation offset is implemented in AbstractFetcherThread.getOffsetTruncationState
0 commit comments