Skip to content
Snippets Groups Projects
Commit fd427639 authored by Sergey Bronnikov's avatar Sergey Bronnikov Committed by Igor Munkin
Browse files

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.
parent 639ec224
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment