From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 29 Nov 2018 20:43:06 +0300 From: Vladimir Davydov Subject: Re: [tarantool-patches] Re: [PATCH 4/9] gc: run garbage collection in background Message-ID: <20181129174306.5nkwy4utxwmplyoc@esperanza> References: <79d04c42c94507cdab57ab4e0621001a818bf90c.1543419109.git.vdavydov.dev@gmail.com> <20181129164206.GD5760@chai> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181129164206.GD5760@chai> To: Konstantin Osipov Cc: tarantool-patches@freelists.org List-ID: On Thu, Nov 29, 2018 at 07:42:06PM +0300, Konstantin Osipov wrote: > * Vladimir Davydov [18/11/28 19:16]: > > Currently, garbage collection is executed synchronously by functions > > that may trigger it, such as gc_consumer_advance or gc_add_checkpoint. > > As a result, one has to be very cautious when using those functions as > > they may yield at their will. For example, we can't shoot off stale > > consumers right in tx_prio handler - we have to use rather clumsy WAL > > watcher interface instead. Besides, in future, when the garbage > > collector state is persisted, we will need to call those functions from > > on_commit trigger callback, where yielding is not normally allowed. > > > > Actually, there's no reason to remove old files synchronously - we could > > as well do it in the background. So this patch introduces a background > > garbage collection fiber that executes gc_run when woken up. Now all > > functions that might trigger garbage collection wake up this fiber > > instead of executing gc_run directly. > > OK to push. Pushed to 2.1.