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

The beginning of heartbeats for pessimistic locks may be too late

Open ekexium opened this issue 4 years ago • 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

ekexium avatar Aug 06 '21 02:08 ekexium