Skip to content

Commit 447c4fe

Browse files
authored
Bump Kvproto (#30)
Signed-off-by: Ana Hobden <[email protected]>
1 parent 5236eba commit 447c4fe

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ failure = "0.1"
2626

2727
[dependencies.kvproto]
2828
git = "https://github.com/pingcap/kvproto.git"
29+
rev = "f9b9e7d362c7cc2c90202fc7c300b2e466cbfbf2"
2930

3031
[dependencies.prometheus]
3132
version = "0.4.2"

src/rpc/tikv/client.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ impl From<errorpb::Error> for Error {
4646
} else if e.has_region_not_found() {
4747
Error::region_not_found(e.get_region_not_found().get_region_id(), Some(message))
4848
} else if e.has_key_not_in_region() {
49-
Error::key_not_in_region(e.take_key_not_in_region())
50-
} else if e.has_stale_epoch() {
51-
let message = format!(
49+
let mut e = e.take_key_not_in_region();
50+
Error::key_not_in_region(e)
51+
} else if e.has_epoch_not_match() {
52+
Error::stale_epoch(Some(format!(
5253
"{}. New epoch: {:?}",
5354
message,
54-
e.get_stale_epoch().get_new_regions()
55-
);
56-
Error::stale_epoch(Some(message))
55+
e.get_epoch_not_match().get_current_regions()
56+
)))
5757
} else if e.has_server_is_busy() {
5858
Error::server_is_busy(e.take_server_is_busy())
5959
} else if e.has_stale_command() {

0 commit comments

Comments
 (0)