From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 3 Aug 2018 18:17:00 +0300 From: Vladimir Davydov Subject: Re: [PATCH] vinyl: flush transactions before setting trigger on altered space Message-ID: <20180803151700.shaatbqui63xbjt3@esperanza> References: <44e0fcd4d14ae056258c8a55a2b68caafac4f356.1533119343.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44e0fcd4d14ae056258c8a55a2b68caafac4f356.1533119343.git.vdavydov.dev@gmail.com> To: kostja@tarantool.org Cc: tarantool-patches@freelists.org List-ID: On Wed, Aug 01, 2018 at 01:44:10PM +0300, Vladimir Davydov wrote: > When building a new index or checking a space format, we propagate > changes done to the space during the procedure with the aid of an > on_replace trigger. The problem is there may be transactions with a > non-empty write set when we install the trigger. Changes done by > those transactions will not be seen by the trigger and so they won't > make it to the new index, resulting in an inconsistency between the > primary and secondary indexes. To fix this issue, let's flush all > active transactions after installing the trigger. If a transaction > fails to commit or rollback within box.cfg.vinyl_timeout seconds, > DDL simply aborts it. > > Closes #3458 > --- Kostja said that we shouldn't introduce any kind of ad-hoc locking in vinyl tx manager, because it will make it difficult to introduce global tx manager locking infrastructure in the future. Instead, he suggested to unconditionally abort all transactions that started before DDL. The patch will follow shortly.