[Tarantool-patches] [PATCH 3/3] box: always reconfigure box at non-first box.cfg()

Igor Munkin imun at tarantool.org
Thu Jun 4 01:41:55 MSK 2020


Sasha,

Thanks for the patch, LGTM, except two typos below.

On 13.05.20, Alexander Turenko wrote:
> From: Maria <maria.khaydich at tarantool.org>
> 
> Calling box.cfg{} more than once does not normally cause any errors
> (even though it might not have any effect). In contrast, assigning
> it to some variable and then using it after the box was configured
> caused an error since the method was overwritten by the initial call
> of <load_cfg>.
> 
> The patch fixes this issue making box.cfg behave consistently in both
> scenarios.
> 
> Follow-up #4231
> 
> Co-developed-by: Alexander Turenko <alexander.turenko at tarantool.org>
> ---
>  src/box/lua/load_cfg.lua                      |  8 +++++
>  .../gh-4231-box-cfg-idempotence.test.lua      | 34 +++++++++++++++++++
>  2 files changed, 42 insertions(+)
>  create mode 100755 test/box-tap/gh-4231-box-cfg-idempotence.test.lua
> 

<snipped>

> diff --git a/test/box-tap/gh-4231-box-cfg-idempotence.test.lua b/test/box-tap/gh-4231-box-cfg-idempotence.test.lua
> new file mode 100755
> index 000000000..4f3ba68a6
> --- /dev/null
> +++ b/test/box-tap/gh-4231-box-cfg-idempotence.test.lua
> @@ -0,0 +1,34 @@
> +#!/usr/bin/env tarantool
> +
> +--
> +-- gh-4231: box.cfg is another function (so called <load_cfg>)
> +-- before box is loaded. Usually a user calls box.cfg({<...>}),
> +-- it configures box and replaces box.cfg implementation to one
> +-- that performs box reconfiguration: so further calls to
> +-- box.cfg({<...>}) reconfigures box.

Typo: s/reconfigures/reconfigure/.

> +--
> +-- However it is possible to save box.cfg value (<load_cfg>)
> +-- before box loading and call it after box loading: the behaviour
> +-- should be the same as for box.cfg call: box should be

Typo: There are two colons in one sentence, so I propose simply to
s/:/and/ the last one.

> +-- reconfigured.
> +--
> +

<snipped>

> -- 
> 2.25.0
> 

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list