Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 3/3] box: always reconfigure box at non-first box.cfg()
Date: Thu, 18 Jun 2020 11:41:12 +0300	[thread overview]
Message-ID: <20200618084112.anu2bi5nscpauzco@tkn_work_nb> (raw)
In-Reply-To: <adcff783-f30c-8a98-6046-a36211ac4a32@tarantool.org>

On Thu, Jun 18, 2020 at 12:26:39AM +0200, Vladislav Shpilevoy wrote:
> Hi! Thanks for the patch!
> 
> >  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
> > 
> > diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua
> > index 9a7b57cd3..014379826 100644
> > --- a/src/box/lua/load_cfg.lua
> > +++ b/src/box/lua/load_cfg.lua
> > @@ -571,6 +571,14 @@ setmetatable(box, {
> >  local box_is_configured = false
> >  
> >  local function load_cfg(cfg)
> > +    -- A user may save box.cfg (this function) before box loading
> > +    -- and call it afterwards. We should reconfigure box in the
> > +    -- case.
> > +    if box_is_configured then
> > +        reload_cfg(box.cfg, cfg)
> 
> Shouldn't you do 'locked(reload_cfg, box.cfg, cfg)'? Otherwise
> you have the same problem as solved in the first commit.

We should not. load_cfg() is always called under the lock unlike
box.execute().

  reply	other threads:[~2020-06-18  8:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12 22:18 [Tarantool-patches] [PATCH 0/3] box.execute() and box.cfg() idempotence and locking Alexander Turenko
2020-05-12 22:18 ` [Tarantool-patches] [PATCH 1/3] box: check whether box is loaded in box.execute() Alexander Turenko
2020-05-22  7:31   ` lvasiliev
2020-06-03 21:58   ` Igor Munkin
2020-06-08 18:58     ` Alexander Turenko
2020-06-11 17:43       ` Igor Munkin
2020-05-12 22:18 ` [Tarantool-patches] [PATCH 2/3] box: always wait box loading " Alexander Turenko
2020-05-22 11:08   ` lvasiliev
2020-06-03 23:12   ` Igor Munkin
2020-05-12 22:18 ` [Tarantool-patches] [PATCH 3/3] box: always reconfigure box at non-first box.cfg() Alexander Turenko
2020-05-22  7:02   ` lvasiliev
2020-06-03 22:41   ` Igor Munkin
2020-06-03 23:22     ` Igor Munkin
2020-06-08 18:59     ` Alexander Turenko
2020-06-17 22:26   ` Vladislav Shpilevoy
2020-06-18  8:41     ` Alexander Turenko [this message]
2020-06-18 22:23       ` Vladislav Shpilevoy
2020-05-22  7:06 ` [Tarantool-patches] [PATCH 0/3] box.execute() and box.cfg() idempotence and locking lvasiliev
2020-06-08 18:59   ` Alexander Turenko
2020-06-17 22:30 ` Vladislav Shpilevoy
2020-06-22 10:11 ` Kirill Yukhin
2020-06-23 23:55   ` Alexander Turenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200618084112.anu2bi5nscpauzco@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 3/3] box: always reconfigure box at non-first box.cfg()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox