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

Pessimistic Lock on key exception

Open jjz921024 opened this issue 3 years ago • 2 comments

Bug Report

1. Describe the bug

lock some key using pessimistic lock cause exception:

2. Minimal reproduce step (Required)

Kvrpcpb.Mutation mutation = Kvrpcpb.Mutation.newBuilder()
            .setKey(primaryKey)
            .setOp(Kvrpcpb.Op.PessimisticLock)
            .build();
RegionStoreClient client = tiSession.getRegionStoreClientBuilder().build(primaryKey);
client.prewrite(backOffer, primaryKey, Collections.singletonList(mutation), startTs, 10_000);

3. What did you see instead (Required)

Exception cause:

org.tikv.common.exception.TiClientInternalException: Prewrite Response failed without a cause
	at org.tikv.common.region.RegionStoreClient.isPrewriteSuccess(RegionStoreClient.java:441) ~[tikv-client-java-3.2.0.jar:na]
	at org.tikv.common.region.RegionStoreClient.prewrite(RegionStoreClient.java:420) ~[tikv-client-java-3.2.0.jar:na]
	at org.tikv.common.region.RegionStoreClient.prewrite(RegionStoreClient.java:368) ~[tikv-client-java-3.2.0.jar:na]

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

success and key had been locked

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

  • Client Java: 3.2.0
  • TiKV: 5.3.0

jjz921024 avatar Apr 12 '22 12:04 jjz921024

Client-java does not support PessimisticLock. it focuses on the RawKV function instead of the transaction for now. For full transaction support, use https://github.com/tikv/client-go instead.

iosmanthus avatar Apr 14 '22 07:04 iosmanthus

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar May 15 '22 00:05 github-actions[bot]