From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: tarantool-patches@freelists.org, imeevma@tarantool.org
Subject: [tarantool-patches] Re: [PATCH v2 1/6] Add space address to index_replace
Date: Tue, 17 Jul 2018 13:18:57 +0300 [thread overview]
Message-ID: <ca2a83fd-294c-7bd1-5116-d4d732fd4859@tarantool.org> (raw)
In-Reply-To: <1afbb8118fcd5b1dca9da8acea419f226cfc8d59.1531742578.git.imeevma@gmail.com>
Hello! Thanks for the patch! See 3 comments below.
1. Please, on the commit title specify a subsystem name which
the patch affected. Here it is 'bos: ' I think.
On 17/07/2018 12:23, imeevma@tarantool.org wrote:
> On error in some cases index_replace
> looking for space using space_id that
> is saved in index. It is wrong as
> function that calls index_replace
> already have that space. Also in case
> of ephemeral spaces space_cache_find
> doesn't work right as all ephemeral
> space have id == 0.
>
> Part of #3375.
> ---
> Branch: https://github.com/tarantool/tarantool/compare/imeevma/gh-3375-lua-expose-ephemeral-spaces
> Issue: https://github.com/tarantool/tarantool/issues/3375
>
> src/box/index.cc | 16 +++++++++-------
> src/box/index.h | 30 +++++++++++++++++-------------
> src/box/memtx_bitset.c | 7 ++++---
> src/box/memtx_engine.c | 6 +++---
> src/box/memtx_hash.c | 12 +++++-------
> src/box/memtx_rtree.c | 7 ++++---
> src/box/memtx_space.c | 13 +++++++------
> src/box/memtx_tree.c | 16 ++++++++--------
> 8 files changed, 57 insertions(+), 50 deletions(-)
>
> diff --git a/src/box/memtx_hash.c b/src/box/memtx_hash.c
> index eae07e8..76fe35f 100644
> --- a/src/box/memtx_hash.c
> +++ b/src/box/memtx_hash.c
> @@ -244,9 +244,9 @@ memtx_hash_index_get(struct index *base, const char *key,
> }
>
> static int
> -memtx_hash_index_replace(struct index *base, struct tuple *old_tuple,
> - struct tuple *new_tuple, enum dup_replace_mode mode,
> - struct tuple **result)
> +memtx_hash_index_replace(struct index *base, struct space *space,
> + struct tuple *old_tuple, struct tuple *new_tuple,
> + enum dup_replace_mode mode, struct tuple **result)
> {
> struct memtx_hash_index *index = (struct memtx_hash_index *)base;
> struct light_index_core *hash_table = &index->hash_table;
> @@ -281,10 +281,8 @@ memtx_hash_index_replace(struct index *base, struct tuple *old_tuple,
> "recover of int hash_table");
> }
> }
> - struct space *sp = space_cache_find(base->def->space_id);
2. Now you can remove schema.h dependency.
> - if (sp != NULL)
> - diag_set(ClientError, errcode, base->def->name,
> - space_name(sp));
> + diag_set(ClientError, errcode, base->def->name,
> + space_name(space));
> return -1;
> }
>
> diff --git a/src/box/memtx_tree.c b/src/box/memtx_tree.c
> index f851fb8..3da52b3 100644
> --- a/src/box/memtx_tree.c
> +++ b/src/box/memtx_tree.c
3. Same.
prev parent reply other threads:[~2018-07-17 10:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1531742578.git.imeevma@gmail.com>
2018-07-17 9:23 ` [tarantool-patches] " imeevma
2018-07-17 10:18 ` Vladislav Shpilevoy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ca2a83fd-294c-7bd1-5116-d4d732fd4859@tarantool.org \
--to=v.shpilevoy@tarantool.org \
--cc=imeevma@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH v2 1/6] Add space address to index_replace' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox