[Tarantool-patches] [PATCH v2 2/9] xrow: introduce a PROMOTE entry

Cyrill Gorcunov gorcunov at gmail.com
Wed Apr 14 13:00:30 MSK 2021


On Wed, Apr 14, 2021 at 12:12:51PM +0300, Serge Petrenko wrote:
> > You know, while I understand that we're trying to reuse code flow
> > here but I really don't like that this function unaware of type passed.
> > IOW the function may easily overwire caller's stack if you occasionally
> > pass synchro_body_bin instead of promote request.
> 
> That's true and I've even caught that bug during the patch development.
> 
> > 
> > Actually I've sevaral options:
> > 
> > 1) make the caller to provide a size and use assert() inside
> >     this encoder to make sure the caller passer proper amount
> >     of data from stack;
> > 2) provide own helper for promote packet encoding (see below).
> > 
> > Still both approaches somehow *ugly* I think. Since there only a
> > few use of this encodings it is easy to remember where and what
> > and don't make a mistake.
> 
> I think your second option looks better than what we have now.
> So, thanks for the suggestion! I've taken your diff with a couple
> of changes, please, take a look.
> 
> The rest of the diff's in the reply for the 4th patch, because the
> changes to txn_limbo.c belong there.

Ack. Thanks!


More information about the Tarantool-patches mailing list