box: add space upgrade stubs
To implement online space upgrade, we need to add stub calls to the following code paths and data structures: - struct space: add a pointer to space upgrade state. - struct space_opts: add a pointer to space upgrade definition. - CheckSpaceFormat::prepare: skip space check if the format is changed in the scope of space upgrade. - alter_space_do: check space upgrade state and fail alter if upgrade is in progress. - alter_space_commit: run background worker for space upgrade. - space_on_final_recovery_complete: restart upgrade after recovery. - result_processor: apply space upgrade transformations to tuples returned to the user by box functions. We also need to: - Add a new error code ER_WRONG_SPACE_UPGRADE_OPTIONS, which we will use on error decoding upgrade options, stored in space options. - Load space upgrade Lua modules. The modules are supposed to define box.internal.space.upgrade method, which if available is used by box.schema.space.upgrade. - Add check_param, check_param_table and normalize_format helpers to box.internal, because we will use them from space.upgrade Lua code. Note, the space upgrade state will be reference counted, because background space upgrade may complete while some fiber is reading from the upgraded space (there may be yields in Vinyl). For this fiber to process the result correctly, it has to increment the reference counter of the space upgrade state before reading from the space. NO_DOC=ee NO_TEST=ee NO_CHANGELOG=ee
Showing
- src/box/CMakeLists.txt 9 additions, 0 deletionssrc/box/CMakeLists.txt
- src/box/alter.cc 13 additions, 0 deletionssrc/box/alter.cc
- src/box/errcode.h 2 additions, 1 deletionsrc/box/errcode.h
- src/box/lua/init.c 14 additions, 0 deletionssrc/box/lua/init.c
- src/box/lua/schema.lua 15 additions, 0 deletionssrc/box/lua/schema.lua
- src/box/memtx_engine.cc 7 additions, 0 deletionssrc/box/memtx_engine.cc
- src/box/result.h 18 additions, 7 deletionssrc/box/result.h
- src/box/space.c 20 additions, 0 deletionssrc/box/space.c
- src/box/space.h 11 additions, 0 deletionssrc/box/space.h
- src/box/space_def.c 23 additions, 0 deletionssrc/box/space_def.c
- src/box/space_def.h 4 additions, 0 deletionssrc/box/space_def.h
- src/box/space_upgrade.c 46 additions, 0 deletionssrc/box/space_upgrade.c
- src/box/space_upgrade.h 131 additions, 0 deletionssrc/box/space_upgrade.h
- src/trivia/config.h.cmake 1 addition, 0 deletionssrc/trivia/config.h.cmake
- test/box/error.result 1 addition, 0 deletionstest/box/error.result
Loading