iit2009060 commented on PR #15060: URL: https://github.com/apache/kafka/pull/15060#issuecomment-1890348438
@satishd @kamalcph @divijvaidya I am able to reproduce the issue which @satishd mentioned , I need to introduced a delay to the movement of segments to remote through a hacky code. 1. Created topic test 10 2. Set segment bytes 100 so that each segment contain only one offset. 3. Set clean up policy compact 4. Produce some messages (1:1,1:2,1:3,1:4,1:5,1:6,1:7) 5. Log compaction is in progress 6. Delete log compaction policy from the topic 8. Enable remote storage enable = true I introduced a code which copied remote segments whose base offset <= 1 in the RemoteLogManager so that we can have a situation where in remote segments data is not available , but in local/active segment data is available. <img width="971" alt="Screenshot 2024-01-13 at 12 01 47 PM" src="https://github.com/apache/kafka/assets/59436466/cc018078-801e-4850-9f1f-917ae6326202"> 9. In the local log segments 0 and 1 has been removed and moved to a remote log storage where the number of bytes is zero as data is removed because of log compaction. Observe local segments contains data only for offset >=2. **Local log segments view** <img width="1627" alt="Screenshot 2024-01-13 at 12 05 08 PM" src="https://github.com/apache/kafka/assets/59436466/6062b6f4-33ba-43dd-8495-2fb9bacff69e"> **Remote log segments view** <img width="1740" alt="Screenshot 2024-01-13 at 12 05 00 PM" src="https://github.com/apache/kafka/assets/59436466/e91e0f5b-1dc4-4569-98e1-a32eebdbaf5c"> Remote log contain only two segments 0 and 1 , both are empty because of log compaction. 10. Execute consumer service `bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test10 --offset 0 --partition 0 --property print.offset=true --property print.key=true --property print.value=true --consumer-property auto.offset.reset=earliest ` This command never proceeds as RemoteLogManager return empty records and we do not have a mechanism yet to handle cases when RemoteLog <img width="1700" alt="Screenshot 2024-01-13 at 12 20 15 PM" src="https://github.com/apache/kafka/assets/59436466/4051d50f-906e-4ee2-8475-a855f51909aa"> Manager return empty records. <img width="1721" alt="Screenshot 2024-01-13 at 11 57 53 AM" src="https://github.com/apache/kafka/assets/59436466/424015c0-c4d3-4b03-ab3c-2940c02a9ad9"> <img width="1791" alt="Screenshot 2024-01-13 at 11 58 26 AM" src="https://github.com/apache/kafka/assets/59436466/334d807a-3f4c-4b00-8990-fde48912b14e"> @satishd @divijvaidya @kamalcph Let me know if you have a suggestion to fix this use case . -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org