divijvaidya commented on code in PR #14363: URL: https://github.com/apache/kafka/pull/14363#discussion_r1321638678
########## storage/src/main/java/org/apache/kafka/storage/internals/log/RemoteIndexCache.java: ########## @@ -382,6 +388,9 @@ private RemoteIndexCache.Entry createCacheEntry(RemoteLogSegmentMetadata remoteL TransactionIndex txnIndex = loadIndexFile(txnIndexFile, remoteLogSegmentMetadata, rlsMetadata -> { try { return remoteStorageManager.fetchIndex(rlsMetadata, IndexType.TRANSACTION); + } catch (RemoteResourceNotFoundException e) { + // Don't throw an exception since the transaction index may not exist because of no transactional records. + return null; Review Comment: yes please. I know it is not necessary for private methods but it would be useful for future code implementors to understand that they are expected to handle nulls returned by this method. -- 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