tikv/client-rust

The beginning of heartbeats for pessimistic locks may be too late

Opened this issue · 0 comments

Current process:

  1. lock all keys
  2. start heartbeat

Consider we lock a lot of keys in a single command, which takes a long time. Before the heartbeat begins, some of the locks may be stale and removed.

A possible improvement:

  1. lock the primary key if it's not locked
  2. start heartbeat
  3. lock other keys