From 12d265c543b4c099159338ec5e8c71fe4c0e4409 Mon Sep 17 00:00:00 2001 From: Tong Zhigao Date: Fri, 20 Mar 2020 14:59:34 +0800 Subject: [PATCH] use peer addr to resolve (#50) Signed-off-by: Tong Zhigao Co-authored-by: Ian --- src/import/client.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/import/client.rs b/src/import/client.rs index acb694d..b254e07 100644 --- a/src/import/client.rs +++ b/src/import/client.rs @@ -101,7 +101,12 @@ impl Client { HashMapEntry::Vacant(e) => { let store = self.pd.get_store(store_id)?; let builder = ChannelBuilder::new(self.env.clone()); - let channel = self.security_mgr.connect(builder, store.get_address()); + let tar_addr = if !store.get_peer_address().is_empty() { + store.get_peer_address() + } else { + store.get_address() + }; + let channel = self.security_mgr.connect(builder, tar_addr); Ok(e.insert(channel).clone()) } }