txm: track read more carefully
The previous commit fixed a bug that caused dirty read but also introduced a much less significat problem - excess conflict in some cases. Usually if a reader reads a tuple - in its story aspecial record is stored. Any write that replaces or deletes that tuple can now cause conflict of current transaction. The problem happened when a reader tries to execute select from some index, but only deleted story is found there. The record is stored and that is good - we must know when somebody will insert a tuple to this place in index. But actually we need to know it only for the index from which the reader executed select. This patch introduces a special index mask in read tracker that is used in the case above to be more precise in conflict detection. Closes #6206
Showing
- changelogs/unreleased/gh-6206-repeat-read-violation.md 3 additions, 0 deletionschangelogs/unreleased/gh-6206-repeat-read-violation.md
- src/box/memtx_tx.c 24 additions, 8 deletionssrc/box/memtx_tx.c
- src/box/memtx_tx.h 2 additions, 0 deletionssrc/box/memtx_tx.h
- test/box/tx_man.result 84 additions, 0 deletionstest/box/tx_man.result
- test/box/tx_man.test.lua 26 additions, 0 deletionstest/box/tx_man.test.lua
Loading
Please register or sign in to comment