<div dir="ltr">In contrast to subsequent calls, the initial call to box.cfg didn't log<br>configuration changes to the default state. As a result, by looking at<br>a log file we couldn't tell which configuration was being used.<br><br>Closes #4236<br>---<br> src/box/lua/load_cfg.lua   |   6 +-<br> test/box/cfg.result        | 900 +++++++++++++++++++------------------<br> test/box/cfg.test.lua      |   9 +<br> test/box/lua/cfg_test5.lua |  10 +<br> 4 files changed, 497 insertions(+), 428 deletions(-)<br> create mode 100644 test/box/lua/cfg_test5.lua<br><br>diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua<br>index 83e99e854..d402468ab 100644<br>--- a/src/box/lua/load_cfg.lua<br>+++ b/src/box/lua/load_cfg.lua<br>@@ -492,8 +492,10 @@ local function load_cfg(cfg)<br>     private.cfg_load()<br>     for key, fun in pairs(dynamic_cfg) do<br>         local val = cfg[key]<br>-        if val ~= nil and not dynamic_cfg_skip_at_load[key] then<br>-            fun()<br>+        if val ~= nil then<br>+            if not dynamic_cfg_skip_at_load[key] then<br>+                fun()<br>+            end<br>             if not compare_cfg(val, default_cfg[key]) then<br>                 <a href="http://log.info">log.info</a>("set '%s' configuration option to %s", key, json.encode(val))<br>             end<br>diff --git a/test/box/cfg.result b/test/box/cfg.result<br>index d85ec634c..cdca64ef0 100644<br>--- a/test/box/cfg.result<br>+++ b/test/box/cfg.result<br>@@ -1,538 +1,586 @@<br>+-- test-run result file version 2<br> env = require('test_run')<br>----<br>-...<br>+ | ---<br>+ | ...<br> test_run = env.new()<br>----<br>-...<br>+ | ---<br>+ | ...<br> test_run:cmd("push filter '(error: .*)\\.lua:[0-9]+: ' to '\\1.lua:<line>: '")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> box.cfg.nosuchoption = 1<br>----<br>-- error: 'builtin/box/load_cfg.lua:<line>: Attempt to modify a read-only table'<br>-...<br>+ | ---<br>+ | - error: 'builtin/box/load_cfg.lua:<line>: Attempt to modify a read-only table'<br>+ | ...<br> cfg_filter(box.cfg)<br>----<br>-- - - background<br>-    - false<br>-  - - checkpoint_count<br>-    - 2<br>-  - - checkpoint_interval<br>-    - 3600<br>-  - - checkpoint_wal_threshold<br>-    - 1000000000000000000<br>-  - - coredump<br>-    - false<br>-  - - feedback_enabled<br>-    - true<br>-  - - feedback_host<br>-    - <a href="https://feedback.tarantool.io">https://feedback.tarantool.io</a><br>-  - - feedback_interval<br>-    - 3600<br>-  - - force_recovery<br>-    - false<br>-  - - hot_standby<br>-    - false<br>-  - - listen<br>-    - <hidden><br>-  - - log<br>-    - <hidden><br>-  - - log_format<br>-    - plain<br>-  - - log_level<br>-    - 5<br>-  - - memtx_dir<br>-    - <hidden><br>-  - - memtx_max_tuple_size<br>-    - <hidden><br>-  - - memtx_memory<br>-    - 107374182<br>-  - - memtx_min_tuple_size<br>-    - <hidden><br>-  - - net_msg_max<br>-    - 768<br>-  - - pid_file<br>-    - <hidden><br>-  - - read_only<br>-    - false<br>-  - - readahead<br>-    - 16320<br>-  - - replication_connect_timeout<br>-    - 30<br>-  - - replication_skip_conflict<br>-    - false<br>-  - - replication_sync_lag<br>-    - 10<br>-  - - replication_sync_timeout<br>-    - 300<br>-  - - replication_timeout<br>-    - 1<br>-  - - rows_per_wal<br>-    - 500000<br>-  - - slab_alloc_factor<br>-    - 1.05<br>-  - - strip_core<br>-    - true<br>-  - - too_long_threshold<br>-    - 0.5<br>-  - - vinyl_bloom_fpr<br>-    - 0.05<br>-  - - vinyl_cache<br>-    - 134217728<br>-  - - vinyl_dir<br>-    - <hidden><br>-  - - vinyl_max_tuple_size<br>-    - 1048576<br>-  - - vinyl_memory<br>-    - 134217728<br>-  - - vinyl_page_size<br>-    - 8192<br>-  - - vinyl_read_threads<br>-    - 1<br>-  - - vinyl_run_count_per_level<br>-    - 2<br>-  - - vinyl_run_size_ratio<br>-    - 3.5<br>-  - - vinyl_timeout<br>-    - 60<br>-  - - vinyl_write_threads<br>-    - 4<br>-  - - wal_dir<br>-    - <hidden><br>-  - - wal_dir_rescan_delay<br>-    - 2<br>-  - - wal_max_size<br>-    - 268435456<br>-  - - wal_mode<br>-    - write<br>-  - - worker_pool_threads<br>-    - 4<br>-...<br>+ | ---<br>+ | - - - background<br>+ |     - false<br>+ |   - - checkpoint_count<br>+ |     - 2<br>+ |   - - checkpoint_interval<br>+ |     - 3600<br>+ |   - - checkpoint_wal_threshold<br>+ |     - 1000000000000000000<br>+ |   - - coredump<br>+ |     - false<br>+ |   - - feedback_enabled<br>+ |     - true<br>+ |   - - feedback_host<br>+ |     - <a href="https://feedback.tarantool.io">https://feedback.tarantool.io</a><br>+ |   - - feedback_interval<br>+ |     - 3600<br>+ |   - - force_recovery<br>+ |     - false<br>+ |   - - hot_standby<br>+ |     - false<br>+ |   - - listen<br>+ |     - <hidden><br>+ |   - - log<br>+ |     - <hidden><br>+ |   - - log_format<br>+ |     - plain<br>+ |   - - log_level<br>+ |     - 5<br>+ |   - - memtx_dir<br>+ |     - <hidden><br>+ |   - - memtx_max_tuple_size<br>+ |     - <hidden><br>+ |   - - memtx_memory<br>+ |     - 107374182<br>+ |   - - memtx_min_tuple_size<br>+ |     - <hidden><br>+ |   - - net_msg_max<br>+ |     - 768<br>+ |   - - pid_file<br>+ |     - <hidden><br>+ |   - - read_only<br>+ |     - false<br>+ |   - - readahead<br>+ |     - 16320<br>+ |   - - replication_connect_timeout<br>+ |     - 30<br>+ |   - - replication_skip_conflict<br>+ |     - false<br>+ |   - - replication_sync_lag<br>+ |     - 10<br>+ |   - - replication_sync_timeout<br>+ |     - 300<br>+ |   - - replication_timeout<br>+ |     - 1<br>+ |   - - rows_per_wal<br>+ |     - 500000<br>+ |   - - slab_alloc_factor<br>+ |     - 1.05<br>+ |   - - strip_core<br>+ |     - true<br>+ |   - - too_long_threshold<br>+ |     - 0.5<br>+ |   - - vinyl_bloom_fpr<br>+ |     - 0.05<br>+ |   - - vinyl_cache<br>+ |     - 134217728<br>+ |   - - vinyl_dir<br>+ |     - <hidden><br>+ |   - - vinyl_max_tuple_size<br>+ |     - 1048576<br>+ |   - - vinyl_memory<br>+ |     - 134217728<br>+ |   - - vinyl_page_size<br>+ |     - 8192<br>+ |   - - vinyl_read_threads<br>+ |     - 1<br>+ |   - - vinyl_run_count_per_level<br>+ |     - 2<br>+ |   - - vinyl_run_size_ratio<br>+ |     - 3.5<br>+ |   - - vinyl_timeout<br>+ |     - 60<br>+ |   - - vinyl_write_threads<br>+ |     - 4<br>+ |   - - wal_dir<br>+ |     - <hidden><br>+ |   - - wal_dir_rescan_delay<br>+ |     - 2<br>+ |   - - wal_max_size<br>+ |     - 268435456<br>+ |   - - wal_mode<br>+ |     - write<br>+ |   - - worker_pool_threads<br>+ |     - 4<br>+ | ...<br> -- must be read-only<br> box.cfg()<br>----<br>-...<br>+ | ---<br>+ | ...<br> cfg_filter(box.cfg)<br>----<br>-- - - background<br>-    - false<br>-  - - checkpoint_count<br>-    - 2<br>-  - - checkpoint_interval<br>-    - 3600<br>-  - - checkpoint_wal_threshold<br>-    - 1000000000000000000<br>-  - - coredump<br>-    - false<br>-  - - feedback_enabled<br>-    - true<br>-  - - feedback_host<br>-    - <a href="https://feedback.tarantool.io">https://feedback.tarantool.io</a><br>-  - - feedback_interval<br>-    - 3600<br>-  - - force_recovery<br>-    - false<br>-  - - hot_standby<br>-    - false<br>-  - - listen<br>-    - <hidden><br>-  - - log<br>-    - <hidden><br>-  - - log_format<br>-    - plain<br>-  - - log_level<br>-    - 5<br>-  - - memtx_dir<br>-    - <hidden><br>-  - - memtx_max_tuple_size<br>-    - <hidden><br>-  - - memtx_memory<br>-    - 107374182<br>-  - - memtx_min_tuple_size<br>-    - <hidden><br>-  - - net_msg_max<br>-    - 768<br>-  - - pid_file<br>-    - <hidden><br>-  - - read_only<br>-    - false<br>-  - - readahead<br>-    - 16320<br>-  - - replication_connect_timeout<br>-    - 30<br>-  - - replication_skip_conflict<br>-    - false<br>-  - - replication_sync_lag<br>-    - 10<br>-  - - replication_sync_timeout<br>-    - 300<br>-  - - replication_timeout<br>-    - 1<br>-  - - rows_per_wal<br>-    - 500000<br>-  - - slab_alloc_factor<br>-    - 1.05<br>-  - - strip_core<br>-    - true<br>-  - - too_long_threshold<br>-    - 0.5<br>-  - - vinyl_bloom_fpr<br>-    - 0.05<br>-  - - vinyl_cache<br>-    - 134217728<br>-  - - vinyl_dir<br>-    - <hidden><br>-  - - vinyl_max_tuple_size<br>-    - 1048576<br>-  - - vinyl_memory<br>-    - 134217728<br>-  - - vinyl_page_size<br>-    - 8192<br>-  - - vinyl_read_threads<br>-    - 1<br>-  - - vinyl_run_count_per_level<br>-    - 2<br>-  - - vinyl_run_size_ratio<br>-    - 3.5<br>-  - - vinyl_timeout<br>-    - 60<br>-  - - vinyl_write_threads<br>-    - 4<br>-  - - wal_dir<br>-    - <hidden><br>-  - - wal_dir_rescan_delay<br>-    - 2<br>-  - - wal_max_size<br>-    - 268435456<br>-  - - wal_mode<br>-    - write<br>-  - - worker_pool_threads<br>-    - 4<br>-...<br>+ | ---<br>+ | - - - background<br>+ |     - false<br>+ |   - - checkpoint_count<br>+ |     - 2<br>+ |   - - checkpoint_interval<br>+ |     - 3600<br>+ |   - - checkpoint_wal_threshold<br>+ |     - 1000000000000000000<br>+ |   - - coredump<br>+ |     - false<br>+ |   - - feedback_enabled<br>+ |     - true<br>+ |   - - feedback_host<br>+ |     - <a href="https://feedback.tarantool.io">https://feedback.tarantool.io</a><br>+ |   - - feedback_interval<br>+ |     - 3600<br>+ |   - - force_recovery<br>+ |     - false<br>+ |   - - hot_standby<br>+ |     - false<br>+ |   - - listen<br>+ |     - <hidden><br>+ |   - - log<br>+ |     - <hidden><br>+ |   - - log_format<br>+ |     - plain<br>+ |   - - log_level<br>+ |     - 5<br>+ |   - - memtx_dir<br>+ |     - <hidden><br>+ |   - - memtx_max_tuple_size<br>+ |     - <hidden><br>+ |   - - memtx_memory<br>+ |     - 107374182<br>+ |   - - memtx_min_tuple_size<br>+ |     - <hidden><br>+ |   - - net_msg_max<br>+ |     - 768<br>+ |   - - pid_file<br>+ |     - <hidden><br>+ |   - - read_only<br>+ |     - false<br>+ |   - - readahead<br>+ |     - 16320<br>+ |   - - replication_connect_timeout<br>+ |     - 30<br>+ |   - - replication_skip_conflict<br>+ |     - false<br>+ |   - - replication_sync_lag<br>+ |     - 10<br>+ |   - - replication_sync_timeout<br>+ |     - 300<br>+ |   - - replication_timeout<br>+ |     - 1<br>+ |   - - rows_per_wal<br>+ |     - 500000<br>+ |   - - slab_alloc_factor<br>+ |     - 1.05<br>+ |   - - strip_core<br>+ |     - true<br>+ |   - - too_long_threshold<br>+ |     - 0.5<br>+ |   - - vinyl_bloom_fpr<br>+ |     - 0.05<br>+ |   - - vinyl_cache<br>+ |     - 134217728<br>+ |   - - vinyl_dir<br>+ |     - <hidden><br>+ |   - - vinyl_max_tuple_size<br>+ |     - 1048576<br>+ |   - - vinyl_memory<br>+ |     - 134217728<br>+ |   - - vinyl_page_size<br>+ |     - 8192<br>+ |   - - vinyl_read_threads<br>+ |     - 1<br>+ |   - - vinyl_run_count_per_level<br>+ |     - 2<br>+ |   - - vinyl_run_size_ratio<br>+ |     - 3.5<br>+ |   - - vinyl_timeout<br>+ |     - 60<br>+ |   - - vinyl_write_threads<br>+ |     - 4<br>+ |   - - wal_dir<br>+ |     - <hidden><br>+ |   - - wal_dir_rescan_delay<br>+ |     - 2<br>+ |   - - wal_max_size<br>+ |     - 268435456<br>+ |   - - wal_mode<br>+ |     - write<br>+ |   - - worker_pool_threads<br>+ |     - 4<br>+ | ...<br>+<br> -- check that cfg with unexpected parameter fails.<br> box.cfg{sherlock = 'holmes'}<br>----<br>-- error: 'Incorrect value for option ''sherlock'': unexpected option'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''sherlock'': unexpected option'<br>+ | ...<br>+<br> -- check that cfg with unexpected type of parameter fails<br> box.cfg{listen = {}}<br>----<br>-- error: 'Incorrect value for option ''listen'': should be one of types string, number'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''listen'': should be one of types string, number'<br>+ | ...<br> box.cfg{wal_dir = 0}<br>----<br>-- error: 'Incorrect value for option ''wal_dir'': should be of type string'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''wal_dir'': should be of type string'<br>+ | ...<br> box.cfg{coredump = 'true'}<br>----<br>-- error: 'Incorrect value for option ''coredump'': should be of type boolean'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''coredump'': should be of type boolean'<br>+ | ...<br>+<br> -- check comment to issue #2191 - bad argument #2 to ''uri_parse''<br> box.cfg{replication = {}}<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg{replication = {}}<br>----<br>-...<br>+ | ---<br>+ | ...<br>+<br> --------------------------------------------------------------------------------<br> -- Test of hierarchical cfg type check<br> --------------------------------------------------------------------------------<br>+<br> box.cfg{memtx_memory = "100500"}<br>----<br>-- error: 'Incorrect value for option ''memtx_memory'': should be of type number'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''memtx_memory'': should be of type number'<br>+ | ...<br> box.cfg{memtx_memory = -1}<br>----<br>-- error: 'Incorrect value for option ''memtx_memory'': must not be less than 0'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''memtx_memory'': must not be less than 0'<br>+ | ...<br> box.cfg{vinyl_memory = -1}<br>----<br>-- error: 'Incorrect value for option ''vinyl_memory'': must not be less than 0'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''vinyl_memory'': must not be less than 0'<br>+ | ...<br> box.cfg{vinyl = "vinyl"}<br>----<br>-- error: 'Incorrect value for option ''vinyl'': unexpected option'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''vinyl'': unexpected option'<br>+ | ...<br> box.cfg{vinyl_write_threads = "threads"}<br>----<br>-- error: 'Incorrect value for option ''vinyl_write_threads'': should be of type number'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''vinyl_write_threads'': should be of type number'<br>+ | ...<br>+<br> --------------------------------------------------------------------------------<br> -- Dynamic configuration check<br> --------------------------------------------------------------------------------<br>+<br> replication_sync_lag = box.cfg.replication_sync_lag<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg{replication_sync_lag = 0.123}<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg.replication_sync_lag<br>----<br>-- 0.123<br>-...<br>+ | ---<br>+ | - 0.123<br>+ | ...<br> box.cfg{replication_sync_lag = replication_sync_lag}<br>----<br>-...<br>+ | ---<br>+ | ...<br>+<br> replication_sync_timeout = box.cfg.replication_sync_timeout<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg{replication_sync_timeout = 123}<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg.replication_sync_timeout<br>----<br>-- 123<br>-...<br>+ | ---<br>+ | - 123<br>+ | ...<br> box.cfg{replication_sync_timeout = replication_sync_timeout}<br>----<br>-...<br>+ | ---<br>+ | ...<br>+<br> box.cfg{instance_uuid = box.info.uuid}<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg{instance_uuid = '12345678-0123-5678-1234-abcdefabcdef'}<br>----<br>-- error: Can't set option 'instance_uuid' dynamically<br>-...<br>+ | ---<br>+ | - error: Can't set option 'instance_uuid' dynamically<br>+ | ...<br>+<br> box.cfg{replicaset_uuid = box.info.cluster.uuid}<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg{replicaset_uuid = '12345678-0123-5678-1234-abcdefabcdef'}<br>----<br>-- error: Can't set option 'replicaset_uuid' dynamically<br>-...<br>+ | ---<br>+ | - error: Can't set option 'replicaset_uuid' dynamically<br>+ | ...<br>+<br> box.cfg{memtx_memory = box.cfg.memtx_memory}<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg{vinyl_memory = box.cfg.vinyl_memory}<br>----<br>-...<br>+ | ---<br>+ | ...<br>+<br> --------------------------------------------------------------------------------<br> -- Test of default cfg options<br> --------------------------------------------------------------------------------<br>+<br> test_run:cmd('create server cfg_tester1 with script = "box/lua/cfg_test1.lua"')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("start server cfg_tester1")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd('switch cfg_tester1')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> box.cfg.memtx_memory, box.cfg.slab_alloc_factor, box.cfg.vinyl_write_threads<br>----<br>-- 268435456<br>-- 1.05<br>-- 4<br>-...<br>+ | ---<br>+ | - 268435456<br>+ | - 1.05<br>+ | - 4<br>+ | ...<br> test_run:cmd("switch default")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("stop server cfg_tester1")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("cleanup server cfg_tester1")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br>+<br> test_run:cmd('create server cfg_tester2 with script = "box/lua/cfg_test2.lua"')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("start server cfg_tester2")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd('switch cfg_tester2')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> box.cfg.memtx_memory, box.cfg.slab_alloc_factor, box.cfg.vinyl_write_threads<br>----<br>-- 214748364<br>-- 1.05<br>-- 4<br>-...<br>+ | ---<br>+ | - 214748364<br>+ | - 1.05<br>+ | - 4<br>+ | ...<br> test_run:cmd("switch default")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("stop server cfg_tester2")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("cleanup server cfg_tester2")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br>+<br> test_run:cmd('create server cfg_tester3 with script = "box/lua/cfg_test3.lua"')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("start server cfg_tester3")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd('switch cfg_tester3')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> box.cfg.memtx_memory, box.cfg.slab_alloc_factor, box.cfg.vinyl_write_threads<br>----<br>-- 214748364<br>-- 1.05<br>-- 10<br>-...<br>+ | ---<br>+ | - 214748364<br>+ | - 1.05<br>+ | - 10<br>+ | ...<br> test_run:cmd("switch default")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("stop server cfg_tester3")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("cleanup server cfg_tester3")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br>+<br> test_run:cmd('create server cfg_tester4 with script = "box/lua/cfg_test4.lua"')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("start server cfg_tester4")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd('switch cfg_tester4')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> box.cfg.memtx_memory, box.cfg.slab_alloc_factor, box.cfg.vinyl_write_threads<br>----<br>-- 268435456<br>-- 3.14<br>-- 4<br>-...<br>+ | ---<br>+ | - 268435456<br>+ | - 3.14<br>+ | - 4<br>+ | ...<br> test_run:cmd("switch default")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("stop server cfg_tester4")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("cleanup server cfg_tester4")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br>+<br> --------------------------------------------------------------------------------<br> -- Check fix for pid_file option overwritten by tarantoolctl<br> --------------------------------------------------------------------------------<br>+<br> test_run:cmd('create server cfg_tester5 with script = "box/lua/cfg_test1.lua"')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("start server cfg_tester5")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd('switch cfg_tester5')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> box.cfg{pid_file = "current.pid"}<br>----<br>-...<br>+ | ---<br>+ | ...<br> test_run:cmd("switch default")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("stop server cfg_tester5")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("cleanup server cfg_tester5")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br>+<br> --------------------------------------------------------------------------------<br> -- Check that 'vinyl_dir' cfg option is not checked as long as<br> -- there is no vinyl indexes (issue #2664)<br> --------------------------------------------------------------------------------<br>+<br> test_run:cmd('create server cfg_tester with script = "box/lua/cfg_bad_vinyl_dir.lua"')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("start server cfg_tester")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd('switch cfg_tester')<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> _ = box.schema.space.create('test_memtx', {engine = 'memtx'})<br>----<br>-...<br>+ | ---<br>+ | ...<br> _ = box.space.test_memtx:create_index('pk') -- ok<br>----<br>-...<br>+ | ---<br>+ | ...<br> _ = box.schema.space.create('test_vinyl', {engine = 'vinyl'})<br>----<br>-...<br>+ | ---<br>+ | ...<br> _ = box.space.test_vinyl:create_index('pk') -- error<br>----<br>-- error: can not access vinyl data directory<br>-...<br>+ | ---<br>+ | - error: can not access vinyl data directory<br>+ | ...<br> box.snapshot()<br>----<br>-- ok<br>-...<br>+ | ---<br>+ | - ok<br>+ | ...<br> test_run:cmd("restart server cfg_tester")<br>+ | <br> test_run:cmd("switch default")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("stop server cfg_tester")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br> test_run:cmd("cleanup server cfg_tester")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br>+<br> --<br> -- gh-3320: box.cfg{net_msg_max}.<br> --<br> box.cfg{net_msg_max = 'invalid'}<br>----<br>-- error: 'Incorrect value for option ''net_msg_max'': should be of type number'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''net_msg_max'': should be of type number'<br>+ | ...<br> --<br> -- gh-3425: incorrect error message: must not contain 'iproto'.<br> --<br> box.cfg{net_msg_max = 0}<br>----<br>-- error: 'Incorrect value for option ''net_msg_max'': minimal value is 2'<br>-...<br>+ | ---<br>+ | - error: 'Incorrect value for option ''net_msg_max'': minimal value is 2'<br>+ | ...<br> old = box.cfg.net_msg_max<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg{net_msg_max = 2}<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg{net_msg_max = old + 1000}<br>----<br>-...<br>+ | ---<br>+ | ...<br> box.cfg{net_msg_max = old}<br>----<br>-...<br>+ | ---<br>+ | ...<br>+<br> test_run:cmd("clear filter")<br>----<br>-- true<br>-...<br>+ | ---<br>+ | - true<br>+ | ...<br>+<br>+--<br>+-- gh-4236: initial box.cfg{} call did not log changes to default state<br>+--<br>+test_run:cmd('create server cfg_tester6 with script = "box/lua/cfg_test5.lua"')<br>+ | ---<br>+ | - true<br>+ | ...<br>+test_run:cmd("start server cfg_tester6")<br>+ | ---<br>+ | - true<br>+ | ...<br>+test_run:grep_log('cfg_tester6', 'set \'vinyl_memory\' configuration option to 1073741824', 1000)<br>+ | ---<br>+ | - set 'vinyl_memory' configuration option to 1073741824<br>+ | ...<br>+test_run:cmd("stop server cfg_tester6")<br>+ | ---<br>+ | - true<br>+ | ...<br>+test_run:cmd("cleanup server cfg_tester6")<br>+ | ---<br>+ | - true<br>+ | ...<br>diff --git a/test/box/cfg.test.lua b/test/box/cfg.test.lua<br>index eddeab126..56ccb6767 100644<br>--- a/test/box/cfg.test.lua<br>+++ b/test/box/cfg.test.lua<br>@@ -132,3 +132,12 @@ box.cfg{net_msg_max = old + 1000}<br> box.cfg{net_msg_max = old}<br> <br> test_run:cmd("clear filter")<br>+<br>+--<br>+-- gh-4236: initial box.cfg{} call did not log changes to default state<br>+--<br>+test_run:cmd('create server cfg_tester6 with script = "box/lua/cfg_test5.lua"')<br>+test_run:cmd("start server cfg_tester6")<br>+test_run:grep_log('cfg_tester6', 'set \'vinyl_memory\' configuration option to 1073741824', 1000)<br>+test_run:cmd("stop server cfg_tester6")<br>+test_run:cmd("cleanup server cfg_tester6")<br>diff --git a/test/box/lua/cfg_test5.lua b/test/box/lua/cfg_test5.lua<br>new file mode 100644<br>index 000000000..e3eb87392<br>--- /dev/null<br>+++ b/test/box/lua/cfg_test5.lua<br>@@ -0,0 +1,10 @@<br>+#!/usr/bin/env tarantool<br>+os = require('os')<br>+<br>+box.cfg{<br>+    listen              = os.getenv("LISTEN"),<br>+    vinyl_memory = 1024 * 1024 * 1024<br>+}<br>+<br>+require('console').listen(os.getenv('ADMIN'))<br>+box.schema.user.grant('guest', 'read,write,execute', 'universe')<br>\ No newline at end of file<br>-- <br>2.21.0<br></div>