box/lua: raise an error on changing box options directly
Tarantool has a special table 'box.cfg' that includes configuration parameters. User could view that table, but it's direct modification had no effect - after assigning a new value it is actually "updated", but actual value remains the same. Such behaviour is a counterintuitive for our users and provides a bad experience. Proposed patch change this behaviour: new value assigned to parameter via direct access to table box.cfg raise an error. Before the patch: tarantool> box.cfg{} <snipped> tarantool> box.cfg.read_only=true --- ... tarantool> After the patch: NO_WRAP tarantool> box.cfg{} <snipped> tarantool> box.cfg.read_only=true --- - error: 'builtin/box/load_cfg.lua:973: Use box.cfg{read_only = true} for update' ... tarantool> NO_WRAP Closes #2867 @TarantoolBot document Title: Document changed behaviour on setting options to box.cfg directly Tarantool has a special table 'box.cfg' that includes configuration parameters. User could view that table, but it's direct modification has no effect - after assigning a new value it is actually "updated" but actual value remains the same. Such behaviour is a counterintuitive for our users and provides a bad experience. Now new value assigned to parameter via direct access to table box.cfg raise an error.
Showing
- changelogs/unreleased/gh-2867-raise-on-raw-modifications-box.cfg.md 5 additions, 0 deletions.../unreleased/gh-2867-raise-on-raw-modifications-box.cfg.md
- src/CMakeLists.txt 1 addition, 0 deletionssrc/CMakeLists.txt
- src/box/lua/load_cfg.lua 44 additions, 6 deletionssrc/box/lua/load_cfg.lua
- src/lua/init.c 2 additions, 0 deletionssrc/lua/init.c
- src/lua/pairs.lua 16 additions, 0 deletionssrc/lua/pairs.lua
- test/box-luatest/gh_2867_raise_on_raw_box_cfg_modifications_test.lua 35 additions, 0 deletions...atest/gh_2867_raise_on_raw_box_cfg_modifications_test.lua
- test/box/reconfigure.result 0 additions, 6 deletionstest/box/reconfigure.result
- test/box/reconfigure.test.lua 0 additions, 2 deletionstest/box/reconfigure.test.lua
- test/luajit-test-init.lua 12 additions, 0 deletionstest/luajit-test-init.lua
Loading
Please register or sign in to comment