From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 8C826452566 for ; Wed, 13 Nov 2019 07:37:06 +0300 (MSK) Received: by mail-lf1-f67.google.com with SMTP id i26so772607lfl.2 for ; Tue, 12 Nov 2019 20:37:06 -0800 (PST) Date: Wed, 13 Nov 2019 07:37:04 +0300 From: Konstantin Osipov Message-ID: <20191113043704.GB1534@atlas> References: <20191111135246.79818-1-korablev@tarantool.org> <20191112132437.GB96411@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191112132437.GB96411@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH] box: don't allow referenced collation to be dropped List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik Cc: tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy * Nikita Pettik [19/11/12 16:29]: > On 11 Nov 23:38, Vladislav Shpilevoy wrote: > > > > 3. Collations are referenced not only by indexes and spaces. > > Oh, that's pretty sad. AFAIU there's no way to get list of all > existing key defs, so it seems that we have to use reference counters. > I'm going to rework patch and send v2. This is not going to work reliably - reference counting code tends to rot and leak references over time. Basically, if you forget to ref or deref in any place, you will not see it in a test or in a real life. While this piece was ugly but contained in one line, the refcounting will be both ugly and spread all over. Please either consider having an index on collation, so that all references can be checked quickly using a data dictionary, or drop this issue altogether - only a superuser can drop a collation, and this is never used in practice, so not worth fixing, really. -- Konstantin Osipov, Moscow, Russia