Skip to content

Commit

Permalink
resolved_ts: fix check_leader to tiflash proxy (tikv#13312) (tikv#13360)
Browse files Browse the repository at this point in the history
ref tikv#12092, close tikv#13310, ref tikv#13312

For TiFlash proxy, should use store.peer_address instead of store.address.
For TiKV, always use the same peer_address and address, so the change won't affect.

Signed-off-by: ti-srebot <[email protected]>

Co-authored-by: hehechen <[email protected]>
Co-authored-by: Ti Chi Robot <[email protected]>
  • Loading branch information
3 people authored Dec 8, 2022
1 parent deb149e commit f8ecf0b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion components/resolved_ts/src/advance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ async fn get_tikv_client(
CString::new("random id").unwrap(),
CONN_ID.fetch_add(1, Ordering::SeqCst),
);
let channel = security_mgr.connect(cb, &store.address);
let channel = security_mgr.connect(cb, &store.peer_address);
let cli = TikvClient::new(channel);
clients.insert(store_id, cli.clone());
RTS_TIKV_CLIENT_INIT_DURATION_HISTOGRAM.observe(start.saturating_elapsed_secs());
Expand Down
4 changes: 3 additions & 1 deletion src/server/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ where
store.set_id(INVALID_ID);
if cfg.advertise_addr.is_empty() {
store.set_address(cfg.addr.clone());
store.set_peer_address(cfg.addr.clone());
} else {
store.set_address(cfg.advertise_addr.clone())
store.set_address(cfg.advertise_addr.clone());
store.set_peer_address(cfg.advertise_addr.clone());
}
if cfg.advertise_status_addr.is_empty() {
store.set_status_address(cfg.status_addr.clone());
Expand Down

0 comments on commit f8ecf0b

Please sign in to comment.