You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "clolov (via GitHub)" <gi...@apache.org> on 2023/10/31 10:08:17 UTC

Re: [PR] KAFKA-14467:Fixed an issue where local incorrect snapshot files might occur due to first pulling the snapshot file and then truncate [kafka]

clolov commented on PR #14652:
URL: https://github.com/apache/kafka/pull/14652#issuecomment-1786900594

   Heya @hudeqi, thank you for the contribution! I have been reviewing this code change and I am a bit uncertain to its purpose so I wanted to ask some follow up questions. As far as I understand the current code flow roughly does the following:
   1. Download a snapshot file from remote storage
   2. Reset data structures within ProducerStateManager and delete snapshots present in the *snapshots* data structure via the `truncateFullyAndStartAt`
   3. Read all snapshot files on disk and repopulate the data structures inside the ProducerStateManager
   
   However, since downloading the snapshot from remote storage does not update the *snapshots* data structure I do not see how the new file will be deleted as part of the call to `truncateFullyAndStartAt`.
   
   I also found the JIRA description a bit confusing because it kept on linking to comments people made, but none of them detailed how this could be happening.
   
   Could you elaborate how the call to `truncateFullyAndStartAt` will delete the newly downloaded file? Alternatively have I misunderstood what you mean to do with this pull request?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org