gc: add graceful shutdown
We call `gc_shutdown` after all client shutdown fibers is finished. So shutdown is quite simple, we just need to finish checkpoint system fibers. There may be a checkpoint in progress during shutdown. It can by done in `checkpoint_daemon` fiber or in client fiber. Anyway we just need to make sure it is cancellable. In case of memtx we run checkpoint in distinct cord but thanks to `cord_cojoin` semantics cancel is propagated to the cord's main fiber. So let's add a yield to the `checkpoint_f` to make it cancellable. Now we don't need `checkpoint_cancel` at all. At the moment of memtx_engine_shutdown (actually freeing resources) the cord is sure to be terminated. Part of #8423 NO_CHANGELOG=internal NO_DOC=internal
Showing
- src/box/box.cc 1 addition, 0 deletionssrc/box/box.cc
- src/box/gc.c 17 additions, 2 deletionssrc/box/gc.c
- src/box/gc.h 7 additions, 0 deletionssrc/box/gc.h
- src/box/memtx_engine.cc 18 additions, 27 deletionssrc/box/memtx_engine.cc
- src/lib/core/errinj.h 1 addition, 0 deletionssrc/lib/core/errinj.h
- test/app-luatest/shutdown_test.lua 44 additions, 0 deletionstest/app-luatest/shutdown_test.lua
- test/box/errinj.result 1 addition, 0 deletionstest/box/errinj.result
Loading
Please register or sign in to comment