[ 
https://issues.apache.org/jira/browse/KAFKA-4746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15858753#comment-15858753
 ] 

Jason Gustafson commented on KAFKA-4746:
----------------------------------------

Thanks. I was thinking of cases where you're materializing to a persistent data 
store. In any case, I agree it's uncommon.

One minor suggestion on this ticket: in addition to checking on the broker, it 
might make sense to check on the client prior to sending the offset commit. 
That might let us provide a more helpful message. 

> Offsets can be committed for the offsets topic
> ----------------------------------------------
>
>                 Key: KAFKA-4746
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4746
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 0.9.0.0
>            Reporter: Grant Henke
>
> Though this is likely rare and I don't suspect to many people would try to do 
> this, we should prevent users from committing offsets for the offsets topic 
> into the offsets topic. This would essentially create an infinite loop in any 
> consumer consuming from that topic. Also committing offsets for a compacted 
> topic doesn't likely make sense anyway. 
> Here is a quick failing test I wrote to see if this guard exists:
> {code:title=OffsetCommitTest.scala|borderStyle=solid}
>  @Test
>   def testOffsetTopicOffsetCommit() {
>     val topic1 = "__consumer_offsets"
>     // Commit an offset
>     val expectedReplicaAssignment = Map(0  -> List(1))
>     val commitRequest = OffsetCommitRequest(
>       groupId = group,
>       requestInfo = immutable.Map(TopicAndPartition(topic1, 0) -> 
> OffsetAndMetadata(offset=42L)),
>       versionId = 2
>     )
>     val commitResponse = simpleConsumer.commitOffsets(commitRequest)
>     assertEquals(Errors.INVALID_TOPIC_EXCEPTION.code, 
> commitResponse.commitStatus.get(TopicAndPartition(topic1, 0)).get)
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to