Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use original lru crate in meta client and simulation #8956

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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