This is an automated email from the ASF dual-hosted git repository.
chia7712 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push:
new 8f98b974541 KAFKA-19492 Log detailed message for
OffsetOutOfRangeException in deleteRecordsOnLocalLog (#20141)
8f98b974541 is described below
commit 8f98b974541275c3bde70d5735e981cc7602b9dc
Author: Stig Døssing <[email protected]>
AuthorDate: Tue Feb 3 19:00:52 2026 +0100
KAFKA-19492 Log detailed message for OffsetOutOfRangeException in
deleteRecordsOnLocalLog (#20141)
Currently, troubleshooting OFFSET_OUT_OF_RANGE errors during record
deletion is challenging because deleteRecordsOnLocalLog suppresses the
detailed messages carried by OffsetOutOfRangeException.
To enhance the diagnostic capabilities of the Kafka Admin Client, we
should log these specific exception details at the debug level. This
ensures that the original context of the failure is preserved for
developers and operators.
Reviewers: Gaurav Narula <[email protected]>, Chia-Ping Tsai
<[email protected]>
---
core/src/main/scala/kafka/server/ReplicaManager.scala | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/core/src/main/scala/kafka/server/ReplicaManager.scala
b/core/src/main/scala/kafka/server/ReplicaManager.scala
index 4ee24f2e414..210501a04c7 100644
--- a/core/src/main/scala/kafka/server/ReplicaManager.scala
+++ b/core/src/main/scala/kafka/server/ReplicaManager.scala
@@ -1119,10 +1119,12 @@ class ReplicaManager(val config: KafkaConfig,
} catch {
case e@ (_: UnknownTopicOrPartitionException |
_: NotLeaderOrFollowerException |
- _: OffsetOutOfRangeException |
_: PolicyViolationException |
_: KafkaStorageException) =>
(topicPartition, LogDeleteRecordsResult(-1L, -1L, Some(e)))
+ case e: OffsetOutOfRangeException =>
+ debug("Error processing delete records operation on partition
%s".format(topicPartition), e)
+ (topicPartition, LogDeleteRecordsResult(-1L, -1L, Some(e)))
case t: Throwable =>
error("Error processing delete records operation on partition
%s".format(topicPartition), t)
(topicPartition, LogDeleteRecordsResult(-1L, -1L, Some(t)))