From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: [PATCH v2 0/2] vinyl: in a task use copy of index key defs to protect from alter From: "v.shpilevoy@tarantool.org" In-Reply-To: <20180320131328.6kta3736xkejtv7f@esperanza> Date: Tue, 20 Mar 2018 16:18:52 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <9D0F811F-2127-4FE0-B9B0-0286A2BCBEEE@tarantool.org> References: <20180320131328.6kta3736xkejtv7f@esperanza> To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: The patch will be auto-pushed in 4 days, if Kostja would neither ack nor = reject nor review it. > 20 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2018 =D0=B3., =D0=B2 16:13, Vladimir = Davydov =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB= (=D0=B0): >=20 > Looks good to me. >=20 > On Thu, Mar 15, 2018 at 03:19:14PM +0300, Vladislav Shpilevoy wrote: >> Branch: = http://github.com/tarantool/tarantool/tree/gh-3229-space-format-enables-op= tional-v2 >> Issue: https://github.com/tarantool/tarantool/issues/3229 >>=20 >> A vinyl space can be altered in such a way, that key definitions >> of indexes are not changed, but comparators do. It is because >> space format reset can make some indexed fields optional. >>=20 >> To be able update key definitions in place, they must not be used >> in a worker thread. So lets copy key_defs for a worker, and >> update index key definitions in place. >>=20 >> An alternative is key_defs reference counting, but there is open >> questions what to do in key_defs in mems, ranges, iterators, >> runs, slices. Now lets do a hotfix of a crash, and then >> refactoring. >>=20 >> Vladislav Shpilevoy (2): >> Do not mix box_key_def_delete and free to delete key_def >> vinyl: in a task use copy of index key defs to protect from alter >>=20 >> src/box/alter.cc | 3 ++- >> src/box/key_def.cc | 10 ++++++++-- >> src/box/key_def.h | 7 +++++++ >> src/box/schema.cc | 4 ++-- >> src/box/vinyl.c | 10 ++++++++-- >> src/box/vy_index.c | 8 ++++---- >> src/box/vy_scheduler.c | 25 ++++++++++++++++++++++--- >> test/engine/ddl.result | 2 +- >> test/engine/ddl.test.lua | 2 +- >> test/unit/vy_iterators_helper.c | 2 +- >> test/unit/vy_mem.c | 4 ++-- >> test/unit/vy_point_lookup.c | 2 +- >> test/unit/vy_write_iterator.c | 2 +- >> 13 files changed, 60 insertions(+), 21 deletions(-)