Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH 0/4] Abort vinyl transactions before switching to ro
@ 2019-03-04 15:39 Vladimir Davydov
  2019-03-04 15:39 ` [PATCH 1/4] vinyl: rename tx statement begin/rollback routines Vladimir Davydov
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Vladimir Davydov @ 2019-03-04 15:39 UTC (permalink / raw)
  To: kostja; +Cc: georgy, tarantool-patches

In contrast to memtx, vinyl transactions may yield, which opens a time
window for the instance to switch to read-only mode. Since we check ro
flag only before executing a dml request, nothing prevents a transaction
from committing in such a case. This breaks master-replica switching
logic implemented by one of our customers, which justifiably assumes
that no local writes are allowed on an instance once box.cfg{read_only}
returns.

Fix this by forcefully aborting all local rw transactions in vinyl
before switching to read-only mode.

https://github.com/tarantool/tarantool/issues/4016
https://github.com/tarantool/tarantool/commits/dv/gh-4016-vy-abort-writers-for-ro

This patch set is an alternative approach to the fix proposed by Georgy,
for more details see discussion started at:

https://www.freelists.org/post/tarantool-patches/PATCH-Do-not-enable-commit-if-read-only-true

Vladimir Davydov (4):
  vinyl: rename tx statement begin/rollback routines
  vinyl: add tx to writers list in begin_statement engine callback
  engine: add switch_to_ro callback
  vinyl: abort rw transactions when instance switches to ro

 src/box/blackhole.c        |  1 +
 src/box/box.cc             |  7 ++++
 src/box/engine.c           | 14 ++++++++
 src/box/engine.h           | 13 ++++++++
 src/box/memtx_engine.c     |  1 +
 src/box/sysview.c          |  1 +
 src/box/vinyl.c            | 18 +++++++----
 src/box/vy_tx.c            | 34 +++++++++++++++++---
 src/box/vy_tx.h            | 35 +++++++++++++-------
 test/vinyl/errinj.result   | 76 +++++++++++++++++++++++++++++++++++++++++++
 test/vinyl/errinj.test.lua | 30 +++++++++++++++++
 test/vinyl/misc.result     | 80 ++++++++++++++++++++++++++++++++++++++++++++++
 test/vinyl/misc.test.lua   | 39 ++++++++++++++++++++++
 13 files changed, 327 insertions(+), 22 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-03-05  8:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-04 15:39 [PATCH 0/4] Abort vinyl transactions before switching to ro Vladimir Davydov
2019-03-04 15:39 ` [PATCH 1/4] vinyl: rename tx statement begin/rollback routines Vladimir Davydov
2019-03-05  7:29   ` Konstantin Osipov
2019-03-04 15:39 ` [PATCH 2/4] vinyl: add tx to writers list in begin_statement engine callback Vladimir Davydov
2019-03-05  7:30   ` Konstantin Osipov
2019-03-04 15:39 ` [PATCH 3/4] engine: add switch_to_ro callback Vladimir Davydov
2019-03-05  7:31   ` Konstantin Osipov
2019-03-04 15:39 ` [PATCH 4/4] vinyl: abort rw transactions when instance switches to ro Vladimir Davydov
2019-03-05  7:43   ` Konstantin Osipov
2019-03-05  8:35     ` Vladimir Davydov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox