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 E24F829027 for ; Thu, 28 Mar 2019 09:45:53 -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 F5grpo1_1r8j for ; Thu, 28 Mar 2019 09:45:53 -0400 (EDT) Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [94.100.177.104]) (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 2A5211F91F for ; Thu, 28 Mar 2019 09:45:53 -0400 (EDT) Received: by smtp44.i.mail.ru with esmtpa (envelope-from ) id 1h9VLq-0006Mf-TJ for tarantool-patches@freelists.org; Thu, 28 Mar 2019 16:45:51 +0300 Date: Thu, 28 Mar 2019 16:45:50 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 3/4] vinyl: abort affected transactions when space is removed from cache Message-ID: <20190328134550.GB19174@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 * Vladimir Davydov [19/03/24 00:10]: > A DDL operation creates a new struct space container, moving unaffected > indexes from the old container, then destroying it. The problem is there > may be a DML request for this space, which was passed the old container > in the argument list and then yielded on disk read. When it resumes, it > may try to dereference the old space container, which may have already > been destroyed. This will most certainly result in a crash. > > To address this problem, we introduce a new space callback, invalidate, > which is called for the old space on space_cache_replace(). In case of > vinyl, this callback aborts all transactions involving the space. To > prevent a DML request from dereferencing a destroyed space, we also make > the iterator code check the current transaction state after each yield > and return an error if it was aborted. This should make any DML request > bail out early without dereferencing the space anymore. This patch looks good to me. I don't share Georgy's concerns. I would make the name of the callback more explicit, like abort_transactions_in_engine, so that it clear what it is doing now. In future, should we find more use for it, I would rename it. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov