Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scanning data error key_not_in_region #762

Open
yq1263100070 opened this issue Aug 23, 2023 · 1 comment
Open

scanning data error key_not_in_region #762

yq1263100070 opened this issue Aug 23, 2023 · 1 comment
Labels
type/bug Something isn't working

Comments

@yq1263100070
Copy link

Bug Report

1. Describe the bug

Error scanning data from region.

2. Minimal reproduce step (Required)

The above exception occurred when I called the rawKVClient. scan() method

3. What did you see instead (Required)

Caused by: shade.io.grpc.StatusRuntimeException: UNKNOWN: message: "key xxx is not in region key range [xxx, xxx) for region 230"
key_not_in_region {
key: "xxx..."
region_id: 230
start_key: "xxx..."
end_key: "xxx..."
}

    at org.tikv.common.operation.KVErrorHandler.handleResponseError(KVErrorHandler.java:170)
    at org.tikv.common.policy.RetryPolicy.callWithRetry(RetryPolicy.java:66)
    at org.tikv.common.AbstractGRPCClient.callWithRetry(AbstractGRPCClient.java:63)
    at org.tikv.common.region.RegionStoreClient.rawScan(RegionStoreClient.java:407)
    at org.tikv.common.region.RegionStoreClient.rawScan(RegionStoreClient.java:416)
    at org.tikv.common.operation.iterator.RawScanIterator.loadCurrentRegionToCache(RawScanIterator.java:49)
    at org.tikv.common.operation.iterator.ScanIterator.cacheLoadFails(ScanIterator.java:71)
    ... 145 common frames omitted

org.tikv.common.exception.TiClientInternalException: Error scanning data from region.
at org.tikv.common.operation.iterator.ScanIterator.cacheLoadFails(ScanIterator.java:98)
at org.tikv.common.operation.iterator.RawScanIterator.hasNext(RawScanIterator.java:69)
...

org.tikv.common.exception.TiClientInternalException: Error scanning data from region.
at org.tikv.common.operation.iterator.ScanIterator.cacheLoadFails(ScanIterator.java:98)
at org.tikv.common.operation.iterator.RawScanIterator.hasNext(RawScanIterator.java:69)
at java.util.Iterator.forEachRemaining(Iterator.java:115)
...

4. What did you expect to see? (Required)

How to Solve This Problem

5. What are your Java Client and TiKV versions? (Required)

  • Client Java: 2.0
  • TiKV: 6.1.0
@yq1263100070 yq1263100070 added the type/bug Something isn't working label Aug 23, 2023
@niuhf0452
Copy link

niuhf0452 commented Oct 8, 2023

I encountered the same issue.
Client Java: 3.3.5
TiKV: 7.3.0
TiUP Playground: 1.13.0

My code looks like this. Please let me know if there is something wrong with it.

        TiConfiguration conf = TiConfiguration.createDefault("127.0.0.1:2379");
        try (TiSession session = TiSession.create(conf);
             RawKVClient kvClient = session.createRawClient()) {
            var iterator = kvClient.scanPrefix0(ByteString.copyFromUtf8("t"), 100, true);
            iterator.forEachRemaining(System.out::println);
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants