client-rust
client-rust copied to clipboard
adding retryable to scan
solve: https://github.com/tikv/client-rust/issues/455
We were running into an issue with scans where periodically we noticed scans returning empty results for datasets that were present in a cluster. The hypothesis was that the scans were returning empties when the regions are undergoing splits. While trying to reproduce the issue (by issuing splits from pd-ctl), we found out that when there's a region error (epoch_version_mismatch et al), the scan_inner is not triggering any cache invalidations and subsequent retries. The scan simply returns an empty. This PR is fixing the issue by triggering the invalidations and retry for such issues.
@pingyu @ekexium @andylokandy.
Hi @pingyu, are there any more changes you need me to make before this change can be merged? Thanks for taking the time to look at this.
@pingyu Thanks for your feedback. It will be great if you could take another look.
Hi @pingyu , the integration tests pass locally. Not sure why they failed on CI. Please let me know if you need me to make any other change to this PR.
@limbooverlambda Please click the "Details" item on the right side of failed CI to check why CI failed. For example:
Compiling tikv-client v0.3.0 (/home/runner/work/client-rust/client-rust)
error: unexpected `cfg` condition value: `protobuf-codec`
--> src/transaction/requests.rs:907:12
|
907 | #[cfg_attr(feature = "protobuf-codec", allow(clippy::useless_conversion))]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `default`, `integration-tests`, and `prometheus`
= help: consider adding `protobuf-codec` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `-D unexpected-cfgs` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unexpected_cfgs)]`
error: could not compile `tikv-client` (lib test) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
make: *** [Makefile:26: integration-test] Error 101
Error: Process completed with exit code 2.
/cc @iosmanthus
/cc @iosmanthus
PTAL~
@limbooverlambda Thanks for your contribution !