From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4528D2744E for ; Tue, 17 Jul 2018 06:19:00 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EIbNGvHM6y8A for ; Tue, 17 Jul 2018 06:19:00 -0400 (EDT) Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 93214272B4 for ; Tue, 17 Jul 2018 06:18:59 -0400 (EDT) Subject: [tarantool-patches] Re: [PATCH v2 1/6] Add space address to index_replace References: <1afbb8118fcd5b1dca9da8acea419f226cfc8d59.1531742578.git.imeevma@gmail.com> From: Vladislav Shpilevoy Message-ID: Date: Tue, 17 Jul 2018 13:18:57 +0300 MIME-Version: 1.0 In-Reply-To: <1afbb8118fcd5b1dca9da8acea419f226cfc8d59.1531742578.git.imeevma@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-subscribe: List-owner: List-post: List-archive: To: tarantool-patches@freelists.org, imeevma@tarantool.org 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.