Skip to content

rust-driver: an undetermined RegionError is classified as a retryable cluster event #59

Open

Description

@eduralph

Found by the adversarial review of #57 (pin 3408d95). Latent: no scenario or driver op uses raw CAS today.

Since tikv/client-rust#555, raw compare_and_swap is terminal on an ambiguous outcome (src/raw/client.rs:704-706 at 3408d95): it returns the raw Error::RegionError carrying undetermined_result, or a gRPC error, and leaves the caller to classify it ("commit maps it to UndeterminedError").

crates/rust-driver/src/mapping.rs:135 maps every Error::RegionError(_) to Class::RegionError — an inadmissible cluster event the runner retries. So an undetermined CAS outcome, which is a fact about the operation (client rule WR-3: unknown is not failure, and it is not a blip), would be hidden as cluster noise instead of projected as Undetermined.

Fix: in classify_inner, a RegionError whose undetermined_result is set maps to Class::Undetermined (keeping the proto as evidence), before the generic RegionError arm; add a mapping unit test. Do it with the first CAS scenario at the latest, and check the Go driver projects client-go's undetermined CAS the same way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions