-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(storage-manager): remove redundant
is_latest
test
Commit 87f4791 (#1367) introduced a cache to keep track of the timestamps of the publication for each key expression reaching a Storage. The purpose of this cache is to only allow more recent publication to reach the Storage. For lack of a better understanding / reading of the code base, this verification was already performed through the `is_latest` function. Hence, only one of the two verification should remain. This commit removes the `is_latest` function in favour of the more efficient cache: `is_latest` was calling the Storage for every publication to retrieve the latest value associated to the key expression. Note that, in its current state, the cache strategy is not enough: in the unlikely scenario where no publication was made for the `lifespan` of a cached entry (i.e. the entry was garbage collected) and a new publication with an older timestamp is received, then this older publication will reach the Storage. * plugins/zenoh-plugin-storage-manager/src/replica/storage.rs: remove the `is_latest` function. Signed-off-by: Julien Loudet <[email protected]>
- Loading branch information
Showing
1 changed file
with
84 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters