vinyl: add graceful shutdown
Let's stop all vinyl internal fibers and threads. In case of scheduler it looks like we revert the commit e463128e ("vinyl: cancel reader and writer threads on shutdown") so we can again have delay on shutdown in 'vinyl/replica_quota.test'. I guess we should not. At the time of the commit deferring deletes was the default behavior and there is a secondary index in the test space. The deferred deletes involve TX thread communication and at moment of stopping scheduler worker threads the TX event loop was not running. This could result in worker threads hanging on stop. In this patch we stop worker threads in shutdown phase while TX event loop is active. We delete part of the test for #3412 as now we finish fibers that may use the latch. Also we restore destroying the latch. Part of #8423 NO_CHANGELOG=internal NO_DOC=internal
Showing
- src/box/vinyl.c 39 additions, 5 deletionssrc/box/vinyl.c
- src/box/vy_log.c 10 additions, 1 deletionsrc/box/vy_log.c
- src/box/vy_log.h 4 additions, 0 deletionssrc/box/vy_log.h
- src/box/vy_run.c 7 additions, 1 deletionsrc/box/vy_run.c
- src/box/vy_scheduler.c 91 additions, 49 deletionssrc/box/vy_scheduler.c
- src/box/vy_scheduler.h 7 additions, 0 deletionssrc/box/vy_scheduler.h
- src/lib/core/errinj.h 0 additions, 1 deletionsrc/lib/core/errinj.h
- test/box/errinj.result 0 additions, 1 deletiontest/box/errinj.result
- test/vinyl-luatest/shutdown_test.lua 88 additions, 0 deletionstest/vinyl-luatest/shutdown_test.lua
- test/vinyl/errinj.result 3 additions, 21 deletionstest/vinyl/errinj.result
- test/vinyl/errinj.test.lua 3 additions, 10 deletionstest/vinyl/errinj.test.lua
Loading
Please register or sign in to comment