wangwangwar / daily-notes

Daily Notes
4 stars 0 forks source link

Reduce latch wait duration #90

Open wangwangwar opened 4 years ago

wangwangwar commented 4 years ago

https://github.com/tikv/tikv/issues/5746

  1. Use bcc tools pmlock and pmheld to see how bad is the lock contentions when there are many keys concurrently (Sysbench 128 threads batch(batch = 100) insert). In order to preserve the call stack for debugging, we should compile TiKV, libc and pthreads with gcc flag -fno-omit-frame-pointer first.
wangwangwar commented 4 years ago

https://github.com/tikv/tikv/blob/master/src/storage/txn/scheduler.rs https://github.com/tikv/tikv/blob/master/src/storage/txn/latch.rs

When command A need to acquire some latches, but one of latches is temporary acquired by another command, what will command A do now?