[Tarantool-patches] [PATCH v13 11/11] box/journal: redesign journal operations

Konstantin Osipov kostja.osipov at gmail.com
Thu Mar 19 14:12:06 MSK 2020


* Cyrill Gorcunov <gorcunov at gmail.com> [20/03/19 13:51]:

I really it's not worth it, adding a cicrular dependency.

you can declare struct txn in wal.cc, and pass it around by
pointer without using the header.

The whole goal of this refactoring was to move fiber_set_txn() 
outside wal.cc, to txn.cc.

Is it still impossible? let's discuss.

Module boundaries are really important long term. You add it for a
valid reason, and some other patch will begin using txn inside wal
for a silly reason.

> On Thu, Mar 19, 2020 at 01:37:49PM +0300, Konstantin Osipov wrote:
> > * Cyrill Gorcunov <gorcunov at gmail.com> [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.

-- 
Konstantin Osipov, Moscow, Russia


More information about the Tarantool-patches mailing list