memtx: fix a bug with insertion to space during recovery
There was a problem whith on_schema_init trigger. This trigger gives a way to create on_replace trigger that will modify temporary or is_local spaces during recovery from snapshot, but on that stage of recovery process all space indexes are in special build mode when no check for uniqueness are made. I added a new function 'is_recovery_finished' in box.ctl, which gives user ability to check that we are in snapshot recovery stage and can't insert/replace/update/upsert something. Also i added a check for corresponding operations, now they are failed if user tries to do them during snapshot recovery. @TarantoolBot document Title: Add 'is_recovery_finished' function Add 'is_recovery_finished' function in box.ctl to add user ability to check that we are in snapshot recovery stage and can't insert/replace/update/upsert something Closes #5304
Showing
- src/box/box.cc 19 additions, 0 deletionssrc/box/box.cc
- src/box/lua/ctl.c 13 additions, 0 deletionssrc/box/lua/ctl.c
- src/box/memtx_space.h 9 additions, 0 deletionssrc/box/memtx_space.h
- test/box/gh-5304-insert_during_recovery.lua 49 additions, 0 deletionstest/box/gh-5304-insert_during_recovery.lua
- test/box/gh-5304-insert_during_recovery.result 91 additions, 0 deletionstest/box/gh-5304-insert_during_recovery.result
- test/box/gh-5304-insert_during_recovery.test.lua 27 additions, 0 deletionstest/box/gh-5304-insert_during_recovery.test.lua
- test/box/gh-5304-replace_during_recovery.lua 22 additions, 0 deletionstest/box/gh-5304-replace_during_recovery.lua
- test/box/gh-5304-replace_during_recovery.result 69 additions, 0 deletionstest/box/gh-5304-replace_during_recovery.result
- test/box/gh-5304-replace_during_recovery.test.lua 22 additions, 0 deletionstest/box/gh-5304-replace_during_recovery.test.lua
Loading
Please register or sign in to comment