From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A0D654696C3 for ; Sat, 11 Apr 2020 01:32:52 +0300 (MSK) References: <73e1f0baf18ec008312d91db4449447b3c06aa86.1586381297.git.korablev@tarantool.org> <67dd4512-2e87-b9f1-79d4-b7d182c0634e@tarantool.org> <20200410154713.GE9428@tarantool.org> <20200410214509.GC10478@tarantool.org> From: Vladislav Shpilevoy Message-ID: <814d82af-87cd-e464-6845-88535bd374f5@tarantool.org> Date: Sat, 11 Apr 2020 00:32:48 +0200 MIME-Version: 1.0 In-Reply-To: <20200410214509.GC10478@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 2/2] vinyl: clean-up read views if *_build_history() fails List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org On 10/04/2020 23:45, Nikita Pettik wrote: > On 10 Apr 15:47, Nikita Pettik wrote: > > I've also found that vy_read_view_merge() can fail as well during > processing array of read views. Thus, we should clean-up unprocessed > read views as well. Diff: > > diff --git a/src/box/vy_write_iterator.c b/src/box/vy_write_iterator.c > index 7d8c60d73..165b422fd 100644 > --- a/src/box/vy_write_iterator.c > +++ b/src/box/vy_write_iterator.c > @@ -986,8 +986,11 @@ vy_write_iterator_build_read_views(struct vy_write_iterator *stream, int *count) > if (rv->history == NULL) > continue; > if (vy_read_view_merge(stream, hint, rv, > - is_first_insert) != 0) > + is_first_insert) != 0) { > + while (rv >= &stream->read_views[0]) { > + rv->history = NULL; > + rv--; > + } > goto error; The same question as to the previous fix - shouldn't that be cleaned by the function, which created the mess, by vy_read_view_merge() internally? > + } > assert(rv->history == NULL); > if (rv->tuple == NULL) > continue; >