diff --git a/tikv-client/src/main/java/com/pingcap/tikv/allocator/RowIDAllocator.java b/tikv-client/src/main/java/com/pingcap/tikv/allocator/RowIDAllocator.java index 6577937949..078e0408a4 100644 --- a/tikv-client/src/main/java/com/pingcap/tikv/allocator/RowIDAllocator.java +++ b/tikv-client/src/main/java/com/pingcap/tikv/allocator/RowIDAllocator.java @@ -63,6 +63,7 @@ public final class RowIDAllocator implements Serializable { private long end; private final long autoRandomPartition; private final RowIDAllocatorType allocatorType; + private final long RowIDAllocatorTTL = 10000; private static final Logger LOG = LoggerFactory.getLogger(RowIDAllocator.class); @@ -199,7 +200,8 @@ private void set(@Nonnull List pairs, @Nonnull TiTimestamp time return; } TiSession session = ClientSession.getInstance(conf).getTiKVSession(); - TwoPhaseCommitter twoPhaseCommitter = new TwoPhaseCommitter(session, timestamp.getVersion()); + TwoPhaseCommitter twoPhaseCommitter = + new TwoPhaseCommitter(session, timestamp.getVersion(), RowIDAllocatorTTL); BytePairWrapper primaryPair = iterator.next(); twoPhaseCommitter.prewritePrimaryKey( ConcreteBackOffer.newCustomBackOff(TiConfiguration.PREWRITE_MAX_BACKOFF),