diff --git a/Cargo.toml b/Cargo.toml index 6e8cd769..a61b7992 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ prometheus = ["prometheus/push", "prometheus/process"] # Enable integration tests with a running TiKV and PD instance. # Use $PD_ADDRS, comma separated, to set the addresses the tests use. integration-tests = [] -protobuf-codec = [] [lib] name = "tikv_client" diff --git a/src/raw/client.rs b/src/raw/client.rs index e5a996ab..a324b68b 100644 --- a/src/raw/client.rs +++ b/src/raw/client.rs @@ -759,7 +759,7 @@ impl Client { }); } let backoff = DEFAULT_STORE_BACKOFF; - let range = range.into().encode_keyspace(self.keyspace, KeyMode::Raw); + let mut range = range.into().encode_keyspace(self.keyspace, KeyMode::Raw); let mut result = Vec::new(); let mut current_limit = limit; let (start_key, end_key) = range.clone().into_keys(); @@ -788,6 +788,7 @@ impl Client { break; } else { current_key = next_key; + range = BoundRange::new(std::ops::Bound::Included(current_key.clone()), range.to); } } @@ -805,7 +806,6 @@ impl Client { mut scan_args: ScanInnerArgs, ) -> Result<(Option, Key)> { let start_key = scan_args.start_key; - loop { let region = self.rpc.clone().region_for_key(&start_key).await?; let store = self.rpc.clone().store_for_id(region.id()).await?;