[ 
https://issues.apache.org/jira/browse/SAMZA-2802?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alina Shestakova updated SAMZA-2802:
------------------------------------
     Flags: Patch,Important
    Labels: patch pull-request-available  (was: )

> Error in fetch metadata of empty topic
> --------------------------------------
>
>                 Key: SAMZA-2802
>                 URL: https://issues.apache.org/jira/browse/SAMZA-2802
>             Project: Samza
>          Issue Type: Bug
>          Components: kafka
>            Reporter: Alina Shestakova
>            Priority: Major
>              Labels: patch, pull-request-available
>
> In the situation when a topic is empty, but not new (begin offset == end 
> offset != 0) in _fetchTopicPartitionsMetadata_ we subtract 1 from the end 
> offset:
> {{newestOffsets.put(KafkaUtil.toSystemStreamPartition(this.systemName, 
> topicPartition), String.valueOf(offset - 1L));}}
> and later in {_}validateRestoreOffsets{_}:
>  
> {code:java}
> String startingOffset = restoreOffsets.startingOffset; 
> String endingOffset = restoreOffsets.endingOffset; 
> if (endingOffset != null) {     
> Preconditions.checkState(systemAdmin.offsetComparator(endingOffset, 
> startingOffset) >= 0, String.format("Ending offset: %s must be equal to or 
> greater than starting offset: %s", endingOffset, startingOffset)); 
> } {code}
> {{ }}
> we get endingOffset < startingOffset because of subtraction of 1 in 
> {_}fetchTopicPartitionsMetadata{_}.
>  
> pr [https://github.com/apache/samza/pull/1710]
> In this PR if-else block was added to don't subtract 1 from the ending offset 
> when its equal to the beginning offset.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to