Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Igor Munkin <imun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/2] box: make box.cfg idempotent function
Date: Tue, 12 May 2020 19:17:31 +0300	[thread overview]
Message-ID: <20200512161731.tnramfar7q535f4a@tkn_work_nb> (raw)
In-Reply-To: <20200318222602.GF6392@tarantool.org>

I updated the patchset and placed it on the
Totktonada/gh-4231-box-execute-idempotence branch. I'll send it soon.

Aside of changes around Igor's review I made the following changes:

* Rewrote w/o ffi call, using a module local variable.
* Fixed <load_cfg> to actually reconfigure box
  (reload_cfg(cfg) -> reload_cfg(box.cfg, cfg)).
* Replace box.execute with lbox_execute at end of box loading.
* Added a test for <box_load_and_execute>() and box.execute() at box
  loading (in parallel in separate fibers).
* Polished tests: remove execute_is_immutable() function, splitted
  box.execute and box.cfg tests.
* Clarified dynamic box option set functions contract.

> > +local function box_is_configured()
> > +    return ffi.C.box_is_configured()
> > +end
> > +
> 
> Minor: Since box_is_configured is introduced within this patchset it
> could be placed properly in the first patch of the series. Feel free to
> ignore.

Fixed.

> > diff --git a/test/box-tap/gh-4231-immutable-box-execute.test.lua b/test/box-tap/gh-4231-immutable-box-execute.test.lua
> 
> Minor: test chunk name is left unchanged since the previous version and
> doesn't respect the commit message wording.

Renamed to gh-4231-box-execute-idempotence.test.lua.

> > --- gh-4231: box.execute should be an idempotent function
> > --- meaning its effect should be the same if a user chooses
> > --- to use it before explicit box.cfg invocation
> > +-- gh-4231: box.execute should be an idempotent function meaning
> > +-- its effect should be the same if the user chooses to save it
> > +-- before explicit box.cfg{} invocation and use the saved version
> > +-- afterwards.
> > +-- Within the scope of the same issue box.cfg method should also
> > +-- be kept idempotent for the same reasons.
> >  --
> >  
> > -local function execute_is_immutable(execute, cmd, msg)
> > -    local status, err = pcall(execute, cmd)
> > -    test:ok(status and type(err) == 'table', msg)
> > -end
> > -
> >  local box_execute_stub = box.execute
> > --- explicit call to load_cfg
> > +local box_cfg_stub = box.cfg
> > +
> > +-- Explicit box configuration that used to change the behavior.
> >  box.cfg{}
> > +
> >  local box_execute_actual = box.execute
> > +local box_cfg_actual = box.cfg
> >  
> > -execute_is_immutable(box_execute_stub,
> > +local function is_idempotent(method, cmd, msg)
> 
> Minor: IMHO these changes are better to be moved to the first patch of
> the series. Feel free to ignore.

Fixed.

      reply	other threads:[~2020-05-12 16:17 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 11:50 [Tarantool-patches] [PATCH] box.execute should be immutable function Maria
2019-11-14 16:51 ` Nikita Pettik
2019-12-17 14:39 ` Igor Munkin
2019-12-24 15:32   ` [Tarantool-patches] [PATCH] box: make box.execute() immutable Maria Khaydich
2019-12-25  1:30     ` Igor Munkin
2019-12-26 14:08     ` Alexander Turenko
2020-01-13 12:13       ` Maria Khaydich
2020-01-13 15:48         ` Igor Munkin
2020-01-18 10:56           ` Maria Khaydich
2020-02-20 17:51             ` Alexander Turenko
2020-02-20 21:15               ` Igor Munkin
2020-03-11 15:56               ` Maria Khaydich
2020-03-18 22:25                 ` Igor Munkin
2020-05-02 14:52                   ` Alexander Turenko
2020-05-12 16:16                 ` Alexander Turenko
2020-03-11 15:57               ` [Tarantool-patches] [PATCH 1/2] box: make box.cfg idempotent function Maria Khaydich
2020-03-12 13:29                 ` Konstantin Osipov
2020-03-12 19:25                   ` Maria Khaydich
2020-03-12 20:00                     ` Konstantin Osipov
2020-03-18 22:26                       ` Igor Munkin
2020-03-19  7:19                         ` Konstantin Osipov
2020-03-19  9:08                           ` Igor Munkin
2020-03-19 10:06                             ` Konstantin Osipov
2020-03-19 10:26                               ` Igor Munkin
2020-05-06 11:17                           ` Alexander Turenko
2020-05-06 11:49                             ` Konstantin Osipov
2020-05-06 12:53                               ` Alexander Turenko
2020-05-06 13:02                                 ` Konstantin Osipov
2020-05-06 13:13                                   ` Alexander Turenko
2020-03-18 22:26                 ` Igor Munkin
2020-05-12 16:17                   ` Alexander Turenko [this message]

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=20200512161731.tnramfar7q535f4a@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=imun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/2] box: make box.cfg idempotent function' \
    /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