Add hot function reload for C procedures
This patch adds ability to reload C procedures on the fly without downtime. To achive that, Tarantool loads a new copy of shared library and starts routing all new request to the new version. The previous version remains active until all started calls are finished. All shared libraries are loaded with RTLD_LOCAL, therefore two or more copies can co-exist without any problems. From now box loads all external modules via an unique symlink to avoid caching inside dlopen(). If one of some module function is reloaded then all other functions from this module will be reloaded. Reviewed and heavily patched by Roman Tsisyk. Closes #910
Showing
- src/box/box.cc 4 additions, 0 deletionssrc/box/box.cc
- src/box/call.cc 13 additions, 0 deletionssrc/box/call.cc
- src/box/call.h 10 additions, 0 deletionssrc/box/call.h
- src/box/func.c 274 additions, 20 deletionssrc/box/func.c
- src/box/func.h 41 additions, 2 deletionssrc/box/func.h
- src/box/lua/call.c 10 additions, 0 deletionssrc/box/lua/call.c
- src/box/lua/schema.lua 2 additions, 0 deletionssrc/box/lua/schema.lua
- test/box/CMakeLists.txt 3 additions, 1 deletiontest/box/CMakeLists.txt
- test/box/func_reload.result 250 additions, 0 deletionstest/box/func_reload.result
- test/box/func_reload.test.lua 86 additions, 0 deletionstest/box/func_reload.test.lua
- test/box/function1.c 9 additions, 0 deletionstest/box/function1.c
- test/box/function1.result 23 additions, 0 deletionstest/box/function1.result
- test/box/function1.test.lua 9 additions, 0 deletionstest/box/function1.test.lua
- test/box/reload1.c 57 additions, 0 deletionstest/box/reload1.c
- test/box/reload2.c 49 additions, 0 deletionstest/box/reload2.c
Loading
Please register or sign in to comment