From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Vladislav Shpilevoy Subject: [PATCH v2 0/2] vinyl: in a task use copy of index key defs to protect from alter Date: Thu, 15 Mar 2018 15:19:14 +0300 Message-Id: To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com, Vladislav Shpilevoy List-ID: Branch: http://github.com/tarantool/tarantool/tree/gh-3229-space-format-enables-optional-v2 Issue: https://github.com/tarantool/tarantool/issues/3229 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. 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. 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. 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 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(-) -- 2.14.3 (Apple Git-98)