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

KVClient scan error

Open FelixZeng opened this issue 2 years ago • 0 comments

Bug Report

1. KVClient scan error

It occurred exception when using the following method of org.tikv.txn.KVClient. public List<Kvrpcpb.KvPair> scan(ByteString startKey, ByteString endKey, long version) throws GrpcException;

2. Minimal reproduce step (Required)

  1. Insert test data into TiKV using TwoPhaseCommitter successfully Test data contains several KV pairs, and all the keys start with "h[tikv-client-java]txn1`"

  2. Use KVClient.scan to get all the data of which the keys start with "h[tikv-client-java]txn1" KVClient.scan(ByteString.copyFromUtf8("h[tikv-client-java]txn1"), ByteString.copyFromUtf8("h[tikv-client-java]txn1a"), transactionStartTimestamp);

3. What did you see instead (Required)

Scan failed with exceptions like org.tikv.common.exception.TiClientInternalException: Error scanning data from region. org.tikv.common.exception.KeyException: tikv abort txn Error(InvalidKeyRangeMode { cmd: scan, storage_api_version: V2, range: (Some("78000000685B7469FF6B762D636C69656EFF742D6A6176615D74FF786E316000000000FB"), None) })

image image

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

All the data of which the keys start with "h[tikv-client-java]txn1`"

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

  • Client Java: 3.3.4
  • TiKV: v6.1.1

FelixZeng avatar Jun 07 '23 10:06 FelixZeng