From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <v.shpilevoy@tarantool.org>
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\))
Subject: Re: [PATCH 2/2] vinyl: zap upsert_format
From: "v.shpilevoy@tarantool.org" <v.shpilevoy@tarantool.org>
In-Reply-To: <dd2097217b1ccc5c2055b16d729d61d25516b496.1522423771.git.vdavydov.dev@gmail.com>
Date: Mon, 2 Apr 2018 13:58:36 +0300
Content-Transfer-Encoding: quoted-printable
Message-Id: <76D257AF-8668-41E8-B1EB-2D1E7C541189@tarantool.org>
References: <cover.1522423771.git.vdavydov.dev@gmail.com>
 <cover.1522423771.git.vdavydov.dev@gmail.com>
 <dd2097217b1ccc5c2055b16d729d61d25516b496.1522423771.git.vdavydov.dev@gmail.com>
To: Vladimir Davydov <vdavydov.dev@gmail.com>
Cc: Konstantin Osipov <kostja@tarantool.org>, tarantool-patches@freelists.org
List-ID: <tarantool-patches.dev.tarantool.org>

Please, see 2 comments below.

> 30 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2018 =D0=B3., =D0=B2 18:47, Vladimir =
Davydov <vdavydov.dev@gmail.com> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB=
(=D0=B0):
>=20
> The only difference between format of UPSERT statements and format of
> other DML statements of the same index is that the former reserves one
> byte for UPSERT counter, which is needed to schedule UPSERT squashing.
> Since we store UPSERT counter on lsregion now, we don't need a special
> format for UPSERTs anymore. Remove it.
> ---
> src/box/vinyl.c                 | 33 ++++------------------------
> src/box/vy_lsm.c                | 48 =
+++++++++++------------------------------
> src/box/vy_lsm.h                |  5 -----
> src/box/vy_mem.c                | 15 ++++---------
> src/box/vy_mem.h                |  6 +-----
> src/box/vy_point_lookup.c       |  6 ++----
> src/box/vy_read_iterator.c      |  5 ++---
> src/box/vy_run.c                | 33 +++++++++++-----------------
> src/box/vy_run.h                | 11 ++--------
> src/box/vy_scheduler.c          |  8 +++----
> src/box/vy_stmt.c               | 48 =
+++++------------------------------------
> src/box/vy_stmt.h               | 26 +---------------------
> src/box/vy_tx.c                 |  9 +++-----
> src/box/vy_upsert.c             | 11 +++++-----
> src/box/vy_upsert.h             |  3 +--
> src/box/vy_write_iterator.c     | 27 ++++++++---------------
> src/box/vy_write_iterator.h     |  8 +++----
> test/unit/vy_cache.c            | 11 +++++-----
> test/unit/vy_iterators_helper.c | 28 ++++++++----------------
> test/unit/vy_iterators_helper.h |  4 ----
> test/unit/vy_point_lookup.c     | 18 ++++++----------
> test/unit/vy_write_iterator.c   |  6 ++----
> 22 files changed, 95 insertions(+), 274 deletions(-)
>=20
> diff --git a/src/box/vy_mem.c b/src/box/vy_mem.c
> index 1105340c..68abf5bc 100644
> --- a/src/box/vy_mem.c
> +++ b/src/box/vy_mem.c
> @@ -128,19 +125,15 @@ vy_mem_new(struct vy_mem_env *env, int64_t =
generation,
>=20

1. This functions seems to be unused. Can you delete it, please?

> void
> vy_mem_update_formats(struct vy_mem *mem, struct tuple_format =
*new_format,
> -		      struct tuple_format *new_format_with_colmask,
> -		      struct tuple_format *new_upsert_format)
> +		      struct tuple_format *new_format_with_colmask)
> {
> 	assert(mem->count.rows =3D=3D 0);
> 	tuple_format_unref(mem->format);
> 	tuple_format_unref(mem->format_with_colmask);
> -	tuple_format_unref(mem->upsert_format);
> 	mem->format =3D new_format;
> 	mem->format_with_colmask =3D new_format_with_colmask;
> -	mem->upsert_format =3D new_upsert_format;
> 	tuple_format_ref(mem->format);
> 	tuple_format_ref(mem->format_with_colmask);
> -	tuple_format_ref(mem->upsert_format);
> }
>=20
> void
> diff --git a/src/box/vy_run.c b/src/box/vy_run.c
> index da6d5872..637f63fa 100644
> --- a/src/box/vy_run.c
> +++ b/src/box/vy_run.c
> @@ -2205,7 +2202,6 @@ vy_run_rebuild_index(struct vy_run *run, const =
char *dir,

2. Please, update a comment - it seems to be very out of date: =
user_key_def is omitted,
and bloom_fpr is already removed.

> 		     const struct key_def *cmp_def,
> 		     const struct key_def *key_def,
> 		     struct tuple_format *mem_format,
> -		     struct tuple_format *upsert_format,
> 		     const struct index_opts *opts)
> {
> 	assert(run->info.bloom =3D=3D NULL);
>=20
>=20