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 8923926E51 for ; Tue, 20 Aug 2019 06:58:06 -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 dOjCRWOlkeLJ for ; Tue, 20 Aug 2019 06:58:06 -0400 (EDT) Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 E0E7826E4E for ; Tue, 20 Aug 2019 06:58:05 -0400 (EDT) From: =?utf-8?B?0JPQtdC+0YDQs9C40Lkg0JrQuNGA0LjRh9C10L3QutC+?= Subject: [tarantool-patches] Re: [PATCH 1/7] Refactoring: wal writer fiber and queue Date: Tue, 20 Aug 2019 13:57:59 +0300 Message-ID: <2116647.NrKqILBjjZ@localhost> In-Reply-To: <20190816135331.GB18643@atlas> References: <921a4cbb0f93c43954e4b18a0d61ac6dd4a563ea.1565676868.git.georgy@tarantool.org> <20190816135331.GB18643@atlas> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3163593.sbsAFRozdJ"; micalg="pgp-sha256"; protocol="application/pgp-signature" 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: Konstantin Osipov Cc: tarantool-patches@freelists.org --nextPart3163593.sbsAFRozdJ Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Friday, August 16, 2019 4:53:32 PM MSK Konstantin Osipov wrote: > * Georgy Kirichenko [19/08/13 10:30]: > > As wal processes all writes in a cbus loop fiber it isn't possible to > > yield while write. The patch introduces a wal write queue and a wal write > > fiber which fetch a batch from queue and writes it out. Also checkpoint > > requests are going now throw the queue to synchronize a tx checkpoint > > though > > > status with wal. > > I don't understand this patch. > > First, WAL already runs in a fiber, and you can yield. wal could not yield because the same fiber processes cbus events. So there is no chance to wake this fiber up because there is no running fiber to process cbus input. > > cord_costart creates a new fiber, please check out the implementation. > > this is done by this commit: > > commit f4625e64eb99c17910d3f0bcd323e5d82b6d5b31 > Author: Vladimir Davydov > Date: Wed Jul 4 20:20:55 2018 +0300 > > vinyl: use cbus for communication between scheduler and worker threads > > We need cbus for forwarding deferred DELETE statements generated in a > worker thread during primary index compaction to the tx thread where > they can be inserted into secondary indexes. Since pthread mutex/cond > and cbus are incompatible by their nature, let's rework communication > channel between the tx and worker threads using cbus. > > Needed for #2129 > > Check out the commit, it changes cord_start() to cord_costart(). > > > Second, checkpoint message already flushed the queue. So I don't > understand why you need a switch over message type. > > Let's discuss online. --nextPart3163593.sbsAFRozdJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEFZT35EtIMRTDS5hJnoTdFFzh6LUFAl1b0jcACgkQnoTdFFzh 6LVDzgf/Wr1hx+vPZLgj3blmbMXdh6vnojciFSJeR1RcI5Qal4BIORdaKLDbsN+K Ja0yJ+PocCHpmpXaFBD9rb8sHB8EIz4QBQHzyqJAF/ry7/Zw0qxgvQbZEJwBb5DP qg3hbPreulZ9V87mekjZdra6QmTq9Y+hM3eqJ7kWlJey0RVB3wrrVNkDIYHdNH8g 8i6eRU+crHZ2FrNwlqwV29q6BES0ylEJcreuqmp6Iqpy3EzR1UDcS+f9Ktp+b3Pz LFqefDpIGwhfUzNJ7kj/WHmecLH/0+ztHonXriiM0wpw+bBo4y+8oCd5MyyxpJDc +FwH8BNEyZI5jdR9WrDOPElxsiLd6g== =SzFB -----END PGP SIGNATURE----- --nextPart3163593.sbsAFRozdJ--