Skip to content

Commit

Permalink
fix: use original lru crate in meta client and simulation (risingwave…
Browse files Browse the repository at this point in the history
  • Loading branch information
yezizp2012 committed Apr 4, 2023
1 parent 30dca71 commit 43bd8c9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
15 changes: 12 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion src/rpc_client/Cargo.toml
Expand Up @@ -19,7 +19,7 @@ async-trait = "0.1"
either = "1.8.1"
futures = { version = "0.3", default-features = false, features = ["alloc"] }
itertools = "0.10.5"
lru = { git = "https://github.com/risingwavelabs/lru-rs.git", branch = "evict_by_timestamp" }
lru = "0.10.0"
rand = "0.8"
risingwave_common = { path = "../common" }
risingwave_hummock_sdk = { path = "../storage/hummock_sdk" }
Expand Down
5 changes: 3 additions & 2 deletions src/rpc_client/src/meta_client.rs
Expand Up @@ -15,6 +15,7 @@
use std::collections::HashMap;
use std::fmt;
use std::fmt::{Debug, Formatter};
use std::num::NonZeroUsize;
use std::sync::Arc;
use std::time::Duration;

Expand Down Expand Up @@ -1142,7 +1143,7 @@ impl ElectionMemberManagement {
None => {
let endpoint = GrpcMetaClient::addr_to_endpoint(addr.clone())?;
let channel = GrpcMetaClient::connect_to_endpoint(endpoint).await?;
let new_client: MetaMemberServiceClient<Channel> =
let new_client: MetaMemberClient =
MetaMemberServiceClient::new(channel);
*client = Some(new_client.clone());

Expand Down Expand Up @@ -1299,7 +1300,7 @@ impl GrpcMetaClient {
let members = match &strategy {
MetaAddressStrategy::LoadBalance(_) => Either::Left(meta_member_client),
MetaAddressStrategy::List(addrs) => {
let mut members = LruCache::new(20);
let mut members = LruCache::new(NonZeroUsize::new(20).unwrap());
for addr in addrs {
members.put(addr.clone(), None);
}
Expand Down
2 changes: 1 addition & 1 deletion src/tests/simulation/Cargo.toml
Expand Up @@ -20,7 +20,7 @@ etcd-client = { version = "0.2.17", package = "madsim-etcd-client" }
futures = { version = "0.3", default-features = false, features = ["alloc"] }
glob = "0.3"
itertools = "0.10"
lru = { git = "https://github.com/risingwavelabs/lru-rs.git", branch = "evict_by_timestamp" }
lru = "0.10.0"
madsim = "0.2.17"
paste = "1"
pin-project = "1.0"
Expand Down

0 comments on commit 43bd8c9

Please sign in to comment.