[Tarantool-patches] [PATCH v2 4/9] box: make clear_synchro_queue() write a PROMOTE entry instead of CONFIRM + ROLLBACK

Cyrill Gorcunov gorcunov at gmail.com
Tue Apr 13 17:33:14 MSK 2021


On Mon, Apr 12, 2021 at 10:40:17PM +0300, Serge Petrenko wrote:
>  		} else {
> -			txn_limbo_force_empty(&txn_limbo, wait_lsn);
> +			/*
> +			 * Term parameter is unused now, We'll pass
> +			 * box_raft()->term there later.
> +			 */
> +			txn_limbo_write_promote(&txn_limbo, wait_lsn, 0);
> +			struct synchro_request req = {
> +				.type = 0, /* unused */
> +				.replica_id = 0, /* unused */
> +				.origin_id = instance_id,
> +				.lsn = wait_lsn,
> +				.term = 0, /* unused */
> +			};

Is there some particular meaning of zeroifying designated assignments?
I mean why not simply

			struct synchro_request req = {
				.origin_id	= instance_id,
				.lsn		= wait_lsn,
			};

or you wanted to pay attention that the left of the fields are
unused? Just curious, I'm fine with current code.


More information about the Tarantool-patches mailing list