Skip to content

Commit c6555c9

Browse files
committed
fix server side error msg
1 parent 62652a3 commit c6555c9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/src/main/scala/kafka/server/ReplicaManager.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ class ReplicaManager(val config: KafkaConfig,
14881488
debug(s"OffsetRequest with correlation id $correlationId from client $clientId on partition ${topicIdPartition} " +
14891489
s"failed because the provided topic ID ${requestTopicIdOpt.get} does not match the current topic ID $cachedTopicIdOpt.")
14901490
statusByPartition += topicIdPartition ->
1491-
ListOffsetsPartitionStatus.builder().responseOpt(Optional.of(buildErrorResponse(Errors.UNKNOWN_TOPIC_ID, partition))).build()
1491+
ListOffsetsPartitionStatus.builder().responseOpt(Optional.of(buildErrorResponse(Errors.INCONSISTENT_TOPIC_ID, partition))).build()
14921492
} else if (isListOffsetsTimestampUnsupported(partition.timestamp(), version)) {
14931493
statusByPartition += topicIdPartition ->
14941494
ListOffsetsPartitionStatus.builder().responseOpt(Optional.of(buildErrorResponse(Errors.UNSUPPORTED_VERSION, partition))).build()

core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4082,7 +4082,7 @@ class ReplicaManagerTest {
40824082
}
40834083

40844084
@Test
4085-
def testFetchOffsetReturnsUnknownTopicIdOnMismatch(): Unit = {
4085+
def testFetchOffsetReturnsInconsistentTopicIdOnMismatch(): Unit = {
40864086
val replicaManager = setupReplicaManagerWithMockedPurgatories(new MockTimer(time))
40874087
try {
40884088
setupMetadataCacheWithTopicIds(topicIds, replicaManager.metadataCache)
@@ -4118,7 +4118,7 @@ class ReplicaManagerTest {
41184118

41194119
assertNotNull(capturedResponses)
41204120
val partitionResponse = capturedResponses.iterator().next().partitions().iterator().next()
4121-
assertEquals(Errors.UNKNOWN_TOPIC_ID.code, partitionResponse.errorCode)
4121+
assertEquals(Errors.INCONSISTENT_TOPIC_ID.code, partitionResponse.errorCode)
41224122
} finally {
41234123
replicaManager.shutdown(checkpointHW = false)
41244124
}

0 commit comments

Comments
 (0)