Feature: Retrieve Key Log IDs via RaftLogReader::get_key_log_ids()
Key log IDs represent the first log IDs proposed by each Leader. These
IDs enable Openraft to efficiently access log IDs at each index with
a succinct storage.
Previously, key log IDs were obtained using a binary-search-like
algorithm through RaftLogReader. This commit introduces the
RaftLogReader::get_key_log_ids() method, allowing implementations to
directly return a list of key log IDs if the RaftLogStorage can
provide them.
For backward compatibility, a default implementation using the original
binary-search method is provided. No application changes are required
when upgrading to this version.
Tests verifying the implementation are included in
openraft::testing::log::suite::Suite.
Changelog
Feature: Retrieve Key Log IDs via
RaftLogReader::get_key_log_ids()
Key log IDs represent the first log IDs proposed by each Leader. These IDs enable Openraft to efficiently access log IDs at each index with a succinct storage.
Previously, key log IDs were obtained using a binary-search-like algorithm through
RaftLogReader
. This commit introduces theRaftLogReader::get_key_log_ids()
method, allowing implementations to directly return a list of key log IDs if theRaftLogStorage
can provide them.For backward compatibility, a default implementation using the original binary-search method is provided. No application changes are required when upgrading to this version.
Tests verifying the implementation are included in
openraft::testing::log::suite::Suite
.This change is