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

John Roesler commented on KAFKA-7640:
-------------------------------------

Hi [~hiteshbachanna],

Sorry for the delay, I'm away on holiday.

Thanks for the extra information, but I'm afraid you're going to have to peel 
back the layers a bit more.

Maybe consider logging the StreamsMetadata object that you get back when you 
query the metadata from KafkaStreams. Is it possible that the serde you pass in 
is not the same as the one that's used to produce the data? Or that the default 
partitioner isn't extracting the right partition for the key? You could maybe 
dig in to the source code of StreamsMetadataState to see how exactly it's going 
to extract the partition for that key, and do the same in your own code to 
verify that the key is in fact in the expected partition.

If the redirected host is returning "null", then it either doesn't think that 
it owns that partition, or it does own that partition but the key is actually 
in a different partition. Maybe if you chase down these questions, you'll get 
enough clarity to figure out what's wrong.

> Kafka stream interactive query not returning data when state is backed by 
> rocksdb
> ---------------------------------------------------------------------------------
>
>                 Key: KAFKA-7640
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7640
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 2.0.0
>            Reporter: hitesh gollahalli bachanna
>            Priority: Major
>         Attachments: intital_data_host.jpeg, rest_api_call_host.jpeg, 
> rest_redirect_host.jpeg
>
>
> I have a kafka stream app running with 36 different instance (one for each 
> partition). Each instance come up one after the other. And I am building rest 
> service on top of the state to access the data.
> Here some code that I use:
> {code:java}
> StreamsMetadata metadata = streams.metadataForKey(store, key, serializer); 
> --> call this find ouy which host has the key
> if (localSelf.host().equals(hostStoreInfo.getHost())) {
> get the key from local store
> }
> else {
> call the remote host using restTemplate
> }{code}
> The problem now is `metadata` object returned has a different host/ip but the 
> data is on a different node. I was able to see using some application logs I 
> printed. This happens every time I start my application.
> The `allMetadata` method in `KafkaStreams` class says the value will be 
> update as when the partition get reassigned. But its not happening in this 
> case. 
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to