-
Notifications
You must be signed in to change notification settings - Fork 176
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): use hash in Replication key expressions
As we were using the key expression of the Storage to generate the key expressions used in the Replication, it was possible to receive Digest emitted by Replicas that were operating on a subset of the key space of the Storage. This commit changes the way the key expressions for the Replication are generated by using the hash of the configuration of the Replication: this renders these key expressions unique, hence avoiding the issue just described. This property is interesting for the initial Alignment: had we not made that change, we would have had to ensure that we perform that Alignment on a Replica operating on exactly the same key space (and not a subset) and the same configuration (in particular, the `strip_prefix`). NOTE: This does not solve the initial alignment step that will still contact Storage that are operating on a subset (if there is no better match on the network). * plugins/zenoh-plugin-storage-manager/src/replication/core.rs: - Renamed `storage_ke` to `hash_configuration` in the key expression formatters of the Digest and the Aligner. - Removed the unnecessary clones when spawning the Digest Publisher + fixed the different call sites. - Removed the scope to access the configuration as we clone it earlier in the code + fixed the different call sites. - Used the hash of the configuration to generate the key expression for the Digest. - Removed the unnecessary clones when spawning the Digest Subscriber + fixed the different call sites. - Used the hash of the configuration to generate the key expression for the Digest. - Removed the unnecessary clones when spawning the Digest Publisher + fixed the different call sites. - Used the hash of the configuration to generate the key expression for the Digest. - Removed the unnecessary clones when spawning the Aligner + fixed the different call sites. - Used the hash of the configuration to generate the key expression for the Aligner Queryable. Signed-off-by: Julien Loudet <[email protected]>
- Loading branch information
Showing
1 changed file
with
55 additions
and
50 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