iit2009060 commented on code in PR #14482: URL: https://github.com/apache/kafka/pull/14482#discussion_r1346943413
########## core/src/test/scala/unit/kafka/log/remote/RemoteIndexCacheTest.scala: ########## @@ -541,6 +542,131 @@ class RemoteIndexCacheTest { verifyFetchIndexInvocation(count = 1) } + @Test + def testIndexFileAlreadyExistOnDiskButNotInCache(): Unit = { Review Comment: @showuon This test "testIndexFileAlreadyExistOnDiskButNotInCache" run for all indexes where file already exists(manually created). I can write another test where instead of manually we derive the existence from the above flow mentioned. 1. Call getIndexEntry 2. Offset index is successfully cached 3. But TimeIndex received from remote storage is corrupted 4. getIndexEntry throws Corrupt Exception 5. Validate offset index remote cache file exists 6. This time remote storage does not return corrupted time index 7. Call getIndexEntry 8. it should succeed , and number of remote storage calls should be 1. Offset index ( 1 for initial getIndexEntry) 2. TimeIndex (2) 3. TransactionIndex(1 , as it was not called in the 1st scenario because of exception) -- 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