Skip to content

Commit

Permalink
Update rust version to 1.75.0 (#4372)
Browse files Browse the repository at this point in the history
* Update rust version to 1.75.0 (#4367)

* Use a pinned hasher to prevent changes between Rust versions

---------

Co-authored-by: Will Leach <will@macbook>
  • Loading branch information
melbourne2991 and Will Leach authored Feb 9, 2024
1 parent 7464ec9 commit 04bbfe0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions quickwit/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions quickwit/quickwit-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ prometheus = { workspace = true }
rand = { workspace = true }
regex = { workspace = true }
serde = { workspace = true }
siphasher = { workspace = true }
tempfile = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions quickwit/quickwit-common/src/rendezvous_hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use std::cmp::Reverse;
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use siphasher::sip::SipHasher;

/// Computes the affinity of a node for a given `key`.
/// A higher value means a higher affinity.
/// This is the `rendezvous hash`.
pub fn node_affinity<T: Hash, U: Hash>(node: T, key: &U) -> u64 {
let mut state = DefaultHasher::new();
let mut state = SipHasher::new();
key.hash(&mut state);
node.hash(&mut state);
state.finish()
Expand Down Expand Up @@ -54,7 +54,7 @@ mod tests {
let socket3 = test_socket_addr(3);
let socket4 = test_socket_addr(4);

let mut socket_set1 = vec![socket1, socket2, socket3, socket4];
let mut socket_set1 = vec![socket4, socket3, socket1, socket2];
sort_by_rendez_vous_hash(&mut socket_set1, "key");

let mut socket_set2 = vec![socket1, socket2, socket4];
Expand All @@ -63,7 +63,7 @@ mod tests {
let mut socket_set3 = vec![socket1, socket4];
sort_by_rendez_vous_hash(&mut socket_set3, "key");

assert_eq!(socket_set1, &[socket1, socket3, socket2, socket4]);
assert_eq!(socket_set1, &[socket1, socket2, socket3, socket4]);
assert_eq!(socket_set2, &[socket1, socket2, socket4]);
assert_eq!(socket_set3, &[socket1, socket4]);
}
Expand Down
2 changes: 1 addition & 1 deletion quickwit/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.72"
channel = "1.75"
components = ["cargo", "clippy", "rustfmt", "rust-docs"]

0 comments on commit 04bbfe0

Please sign in to comment.