Skip to content

Commit

Permalink
added a fix for the bug with the range
Browse files Browse the repository at this point in the history
Signed-off-by: limbooverlambda <[email protected]>
  • Loading branch information
limbooverlambda committed Aug 12, 2024
1 parent 6b40932 commit a7b4b74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/raw/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ impl<PdC: PdClient> Client<PdC> {
});
}
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();
Expand Down Expand Up @@ -788,6 +788,7 @@ impl<PdC: PdClient> Client<PdC> {
break;
} else {
current_key = next_key;
range = BoundRange::new(std::ops::Bound::Included(current_key.clone()), range.to);
}
}

Expand All @@ -805,7 +806,6 @@ impl<PdC: PdClient> Client<PdC> {
mut scan_args: ScanInnerArgs,
) -> Result<(Option<RawScanResponse>, 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?;
Expand Down

0 comments on commit a7b4b74

Please sign in to comment.