Rewrite checkpoint daemon in C
Long time ago, when the checkpoint daemon was added to Tarantool, it was responsible not only for making periodic checkpoints, but also for maintaining the configured number of checkpoints and removing old snap and xlog files, so it was much easier to implement it in Lua than in C. However, over time, all its responsibilities have been reimplemented in C and moved to the server code so that now it just calls box.snapshot() periodically. Let's rewrite this simple procedure in C as well - this will allow us to easily add more complex logic there, e.g. triggering checkpoint when WAL files exceed a configured threshold. Note, this patch removes a few cases from xlog/checkpoint_daemon test that tested the internal state of the checkpoint daemon, which isn't available in Lua anymore. This is OK as those cases are covered by unit/checkpoint_schedule test.
Showing
- src/box/CMakeLists.txt 0 additions, 1 deletionsrc/box/CMakeLists.txt
- src/box/box.cc 7 additions, 0 deletionssrc/box/box.cc
- src/box/box.h 1 addition, 0 deletionssrc/box/box.h
- src/box/gc.c 96 additions, 9 deletionssrc/box/gc.c
- src/box/gc.h 12 additions, 0 deletionssrc/box/gc.h
- src/box/lua/cfg.cc 12 additions, 0 deletionssrc/box/lua/cfg.cc
- src/box/lua/checkpoint_daemon.lua 0 additions, 136 deletionssrc/box/lua/checkpoint_daemon.lua
- src/box/lua/init.c 0 additions, 2 deletionssrc/box/lua/init.c
- src/box/lua/load_cfg.lua 1 addition, 1 deletionsrc/box/lua/load_cfg.lua
- test/xlog/checkpoint_daemon.result 10 additions, 133 deletionstest/xlog/checkpoint_daemon.result
- test/xlog/checkpoint_daemon.test.lua 7 additions, 54 deletionstest/xlog/checkpoint_daemon.test.lua
Loading
Please register or sign in to comment