client-rust icon indicating copy to clipboard operation
client-rust copied to clipboard

adding retryable to scan

Open limbooverlambda opened this issue 1 year ago • 1 comments

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.

limbooverlambda avatar Jun 17 '24 21:06 limbooverlambda

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.

limbooverlambda avatar Jun 28 '24 07:06 limbooverlambda

@pingyu Thanks for your feedback. It will be great if you could take another look.

limbooverlambda avatar Jul 08 '24 20:07 limbooverlambda

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 avatar Jul 12 '24 17:07 limbooverlambda

@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.

zhangjinpeng87 avatar Aug 07 '24 22:08 zhangjinpeng87

/cc @iosmanthus

pingyu avatar Aug 20 '24 13:08 pingyu

/cc @iosmanthus

PTAL~

pingyu avatar Aug 20 '24 13:08 pingyu

@limbooverlambda Thanks for your contribution !

pingyu avatar Aug 23 '24 06:08 pingyu