From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 13 Aug 2018 11:30:28 +0300 From: Vladimir Davydov Subject: Re: [PATCH 3/8] Add 'exact_field_count' parameter to options decoder Message-ID: <20180813083028.xrcdo3d3e7pkcjam@esperanza> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: Vladislav Shpilevoy Cc: tarantool-patches@freelists.org List-ID: 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.