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 0EDF530143 for ; Thu, 29 Nov 2018 11:42:10 -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 5kam3m4HvFOU for ; Thu, 29 Nov 2018 11:42:09 -0500 (EST) Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (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 BF9822A793 for ; Thu, 29 Nov 2018 11:42:09 -0500 (EST) Received: by smtp58.i.mail.ru with esmtpa (envelope-from ) id 1gSPOC-00036j-9h for tarantool-patches@freelists.org; Thu, 29 Nov 2018 19:42:08 +0300 Date: Thu, 29 Nov 2018 19:42:06 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [PATCH 4/9] gc: run garbage collection in background Message-ID: <20181129164206.GD5760@chai> References: <79d04c42c94507cdab57ab4e0621001a818bf90c.1543419109.git.vdavydov.dev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79d04c42c94507cdab57ab4e0621001a818bf90c.1543419109.git.vdavydov.dev@gmail.com> 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 [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. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov