pingcap/tidb

Eliminate unnecessary `PessimisticRollback` when write conflict occurs

Open

#17.597 geöffnet am 2. Juni 2020

Auf GitHub ansehen
 (2 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Go (6.186 Forks)batch import
challenge-programhelp wantedsig/transactiontype/enhancement

Repository-Metriken

Stars
 (40.090 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 14T 4h) (346 gemergte PRs in 30 T)

Beschreibung

Description

When TiDB fails to acquire pessimistic locks due to write conflict, it sends PessimisticRollback to release all locks the DML needs to lock because it's possible some keys needn't be locked after retry. However, the probability is small and PessimisticRollback brings overhead:

  • TiKV process more requests and write more locks.
  • A transaction releases all its locks and if it needs to lock them again, maybe some locks are held by other ones.

Score

  • 4000

SIG Slack Channel

You can join #sig-transaction on slack in your spare time to discuss and get help with mentors or others.

Mentor(s)

  • @youjiali1995

Contact the mentors: #tidb-challenge-program channel in TiDB Community Slack Workspace

Recommended Skills

  • Golang
  • TiDB
  • Pessimistic transaction

Learning Materials

Contributor Guide