[PATCH 3/8] Add 'exact_field_count' parameter to options decoder

Vladimir Davydov vdavydov.dev at gmail.com
Mon Aug 13 11:30:28 MSK 2018


On Wed, Aug 08, 2018 at 01:03:46AM +0300, Vladislav Shpilevoy wrote:
> Needed for promotion. Promotion uses system space
> _promotion, into which a user can write tuples directly
> with not API usage (and we can not do anything with it),
> so _promotion should do severe validation of each field
> of each tuple since it affects the cluster state.
> 
> For this a new parameter of options decoder is introduced,
> that checks for exact field count.

TBH I don't think it's really necessary, because if the user writes to
this table, promotion logic may break anyways AFAIU. So why don't you
just use default parameters if some fields are omitted?

Anyway, passing exact_field_count to a function decoding options from a
map looks kinda weird. And if you decide to extend the options one day,
it will become useless, because you'll have to handle options generated
by older versions which don't have some parameters.



More information about the Tarantool-patches mailing list