tarantool / jepsen.tarantool

Jepsen tests for Tarantool
https://www.tarantool.io/en/
Other
7 stars 0 forks source link

Add test with ERR_INJs for reproducing dirty reads #26

Open ligurio opened 4 years ago

ligurio commented 4 years ago

https://github.com/tarantool/tarantool/issues/5208#issuecomment-682471289

Fault injection на dirty read попробовать в тестах Jepsen.

  1. Обязательно Debug сборка Тарантул.
  2. В отдельном файбере ставим ERRINJ_WAL_DELAY и за ним запись в спейс - этот файбер повиснет после добавления записи
  3. В исходном файбере читаем то, что вставляли в п.2
  4. В исходном файбере (последовательно) выставляем ERRINJ_WAL_WRITE_DISK и снимаем ERRINJ_WAL_DELAY - получаем откат и п.3 становится грязным чтением

пример (сорри за лапидарность):

box.cfg{} box.schema.create_space('t'):create_index('p')
f1=require('fiber').new(function() box.error.injection.set('ERRINJ_WAL_DELAY', true) box.space.t:insert{3} end)
box.space.t:select{}
---
- - [3]
...
box.error.injection.set('ERRINJ_WAL_WRITE_DISK', true)
box.error.injection.set('ERRINJ_WAL_DELAY', false)
box.space.t:select{}
---
- []
...
ligurio commented 3 years ago

Test requires Clojure connector because uses Lua commands that cannot be implemented in SQL (for example operations with fiber). We have plans to implement Clojure connector that allows to send any Lua commands to Tarantool instances (see #53), but it is not a nearest future.