[Tarantool-patches] [PATCH v2 1/9] wal: enrich row's meta information with sync replication flags

Cyrill Gorcunov gorcunov at gmail.com
Tue Apr 13 16:09:31 MSK 2021


On Mon, Apr 12, 2021 at 10:40:14PM +0300, Serge Petrenko wrote:
> @@ -996,7 +996,13 @@ wal_assign_lsn(struct vclock *vclock_diff, struct vclock *base,
>  				first_glob_row = row;
>  			}
>  			(*row)->tsn = tsn == 0 ? (*start)->lsn : tsn;
> -			(*row)->is_commit = row == end - 1;
> +			if (row < end - 1)
> +				continue;

These two lines ^^
Serge, why we need `continue` here at all? Why can't we simply drop the
above `if` saving a branch?

> +			/* Tx meta is stored in the last tx row. */
> +			if (row == end - 1) {
> +				(*row)->opt_flags = entry->opt_flags;
> +				(*row)->is_commit = true;
> +			}

IOW, I mean

		(*row)->tsn = tsn == 0 ? (*start)->lsn : tsn;
		(*row)->is_commit = row == end - 1;
		if (row == end - 1) {
			// Save meta
		}


More information about the Tarantool-patches mailing list