From a6ee0dd6d85e4fbd134e88edeab93bab204a8a5f Mon Sep 17 00:00:00 2001 From: Tong Zhigao Date: Thu, 19 Mar 2020 21:45:31 +0800 Subject: [PATCH] use peer addr to resolve Signed-off-by: Tong Zhigao --- 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 0035d6f..dfd2926 100644 --- a/src/import/client.rs +++ b/src/import/client.rs @@ -100,7 +100,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()) } }