[Tarantool-patches] [PATCH 1/1] xrow: introduce struct synchro_request

Cyrill Gorcunov gorcunov at gmail.com
Fri Aug 14 01:17:57 MSK 2020


On Thu, Aug 13, 2020 at 11:58:20PM +0200, Vladislav Shpilevoy wrote:
...
> +txn_limbo_write_synchro(struct txn_limbo *limbo, uint32_t type, int64_t lsn)
>  {
>  	assert(lsn > 0);
>  
> +	struct synchro_request req;
> +	req.type = type;
> +	req.replica_id = limbo->instance_id;
> +	req.lsn = lsn;
> +

Vlad, while you're at this code, could we please use designated
initialization from the very beginning, ie

	struct synchro_request req = {
		.type		= type,
		.replica_id	= limbo->instance_id,
		.lsn		= lsn,
	};

(the alignment is up to you though). Such initialization won't
allow a bug to happen when we get a structure extension and
other non updated fields will be zeroified.

Other that this looks great!


More information about the Tarantool-patches mailing list