Divij Vaidya created KAFKA-18266:
------------------------------------
Summary: Re-order validation for TimeIndex sanity
Key: KAFKA-18266
URL: https://issues.apache.org/jira/browse/KAFKA-18266
Project: Kafka
Issue Type: Improvement
Reporter: Divij Vaidya
Assignee: Jason Taylor
Currently, when validating the sanity of TimeIndex, we perform multiple
validations. With this change, we want to re-order the validations such that
the expensive ones are performed at the end.
i.e., we want to do
[https://github.com/apache/kafka/blob/9cc1547672a8b261c08f453f45277265dfb44808/storage/src/main/java/org/apache/kafka/storage/internals/log/TimeIndex.java#L79]
after
[https://github.com/apache/kafka/blob/9cc1547672a8b261c08f453f45277265dfb44808/storage/src/main/java/org/apache/kafka/storage/internals/log/TimeIndex.java#L83-L88]
because the former validation performs a read from mmap and hence, is more
expensive compared to the others. In best case scenarios, mmap is completely
mapped to memory and hence, the lookup is cheap but in worst case scenario, OS
will load the data we want to read from mmap on-demand. Hence, the expense.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)