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 EACFE28CAD for ; Mon, 4 Mar 2019 04:41:45 -0500 (EST) 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 MLtnR2zSVrT0 for ; Mon, 4 Mar 2019 04:41:45 -0500 (EST) Received: from smtp63.i.mail.ru (smtp63.i.mail.ru [217.69.128.43]) (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 3CD1928172 for ; Mon, 4 Mar 2019 04:41:45 -0500 (EST) Date: Mon, 4 Mar 2019 12:41:42 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH] Do not enable commit if read_only = true Message-ID: <20190304094142.GA30799@chai> References: <20190227090237.lu32o77lkyllgvui@esperanza> <20190228102530.GB18858@chai> <1779552.GDyJA9gWEY@home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1779552.GDyJA9gWEY@home.lan> 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: =?utf-8?B?0JPQtdC+0YDQs9C40Lkg0JrQuNGA0LjRh9C10L3QutC+?= Cc: tarantool-patches@freelists.org * Георгий Кириченко [19/03/03 23:50]: > On Thursday, February 28, 2019 1:25:30 PM MSK Konstantin Osipov wrote: > > * Vladimir Davydov [19/02/27 12:26]: > > > On Wed, Feb 27, 2019 at 10:36:00AM +0300, Georgy Kirichenko wrote: > > > > Disable commit if server is in read only mode. > > > > > > The commit message is very poor. Please elaborate why this is important. > > > > Having thought about it we should go over all in-flight > > transactions in vinyl and abort them. > > > > We already use this approach on DDL. > > We could make it more general. > I did a little investigation and found that current implementation does not > allow us do reach expected behavior using vinyl aborts because of > * transaction placed in the write set only after uniqueness > check - this leads > to a race if read only was set during this check. tx_manager_abort_writers() looks for a single lsm only anyway. In case of read-only you need to abort all write transactions against all spaces. You have two broad options with this problem: fix the existing infrastructure or begin building a new one. Adding an extra check to txn_commit() is neither. You will have two checks for read_only, but your ddl will continue to be broken. For example, the problem you mention about vinyl write transactions being added to tx_manager->writers after yield also affects vinyl ddl. By adding an extra read_only check to txn_commit() you won't fix it. So I think we should first consider fixing tx_manager->writers list, so that transactions end up in this list before yield, and implementing vy_tx_about_writers() for all write transactions. I asked Vova to look into this since this is vinyl domain and a bit tricky one. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov