From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id C7CBF469719 for ; Thu, 19 Mar 2020 13:49:53 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id r24so1909832ljd.4 for ; Thu, 19 Mar 2020 03:49:53 -0700 (PDT) Date: Thu, 19 Mar 2020 13:49:51 +0300 From: Cyrill Gorcunov Message-ID: <20200319104951.GV27301@uranus> References: <20200319090537.5613-1-gorcunov@gmail.com> <20200319090537.5613-12-gorcunov@gmail.com> <20200319103749.GC11867@atlas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200319103749.GC11867@atlas> Subject: Re: [Tarantool-patches] [PATCH v13 11/11] box/journal: redesign journal operations List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Konstantin Osipov , tml On Thu, Mar 19, 2020 at 01:37:49PM +0300, Konstantin Osipov wrote: > * Cyrill Gorcunov [20/03/19 12:12]: > > --- a/src/box/wal.c > > +++ b/src/box/wal.c > > @@ -32,6 +32,7 @@ > > > > #include "vclock.h" > > #include "fiber.h" > > +#include "txn.h" > > Please try to avoid including txn.h here. > > You can do it, I'm pretty sure. I use fiber_set_txn and in_txn helpers, they are declared in txn.h. The base idea is that setting fiber->storage.txn to NULL is done inside the wal engine and should be transparent to the caller (which implies that fiber->storage.txn is preserved in case of error and txn_rollback call is allowed). Also the sync write in wal engine uses async write internally, so I fetch the current txn via in_txn and pass it as a completion data.