[PATCH 0/3] Force stop of vinyl worker threads on shutdown

Vladimir Davydov vdavydov.dev at gmail.com
Thu Mar 1 13:57:29 MSK 2018


If the user terminates tarantool while compaction is in progress,
tarantool won't exit immediately - it will hang until all dump and
compaction tasks that are currently in progress are complete, which
may take quite a while on large data sets. What is especially funny,
once a task has been finished, vinyl will not commit the produced run
file in the vylog, because the event loop has already been stopped,
and so will delete it after restart and schedule the task anew.

This patch set makes the scheduler forcefully abort all running tasks
as soon as possible. Patch 1 introduces vy_run_writer helper so that
we can check the scheduler state while writing a run file. Patch 2
replaces cord_costart() with cord_start() for worker threads, because
they don't use coio. Patch 3 adds a check to the run writing procedure
that makes it abort if the scheduler is stopping.

https://github.com/tarantool/tarantool/issues/3166
https://github.com/tarantool/tarantool/tree/gh-3166-vy-abort-all-tasks-on-exit

Vladimir Davydov (2):
  vinyl: don't start event loop for worker threads
  vinyl: abort worker threads on shutdown

Vladislav Shpilevoy (1):
  vinyl: introduce vy_run_writer

 src/box/vy_run.c            | 511 +++++++++++++++++++++-----------------------
 src/box/vy_run.h            |  91 +++++++-
 src/box/vy_scheduler.c      |  91 +++++---
 src/errinj.h                |   1 +
 test/box/errinj.result      |   4 +-
 test/unit/vy_point_lookup.c |  47 +++-
 test/vinyl/errinj.result    |  40 ++++
 test/vinyl/errinj.test.lua  |  16 ++
 8 files changed, 492 insertions(+), 309 deletions(-)

-- 
2.11.0




More information about the Tarantool-patches mailing list