[tarantool-patches] Re: [PATCH 8/9] wal: pass struct instead of vclock to checkpoint methods

Konstantin Osipov kostja at tarantool.org
Mon Dec 3 23:20:13 MSK 2018


* Vladimir Davydov <vdavydov.dev at gmail.com> [18/11/30 13:17]:
> On Fri, Nov 30, 2018 at 12:00:14PM +0300, Konstantin Osipov wrote:
> > * Vladimir Davydov <vdavydov.dev at gmail.com> [18/11/28 19:16]:
> > > Currently, we only need to pass a vclock between TX and WAL during
> > > checkpointing. However, in order to implement auto-checkpointing
> > > triggered when WAL size exceeds a certain threshold, we will need to
> > > pass some extra info so that we can properly reset the counter
> > > accounting the WAL size in the WAL thread. To make it possible,let's
> > > move wal_checkpoint struct, which is used internally by WAL to pass a
> > > checkpoint vclock, to the header and require the caller to pass it to
> > > wal_begin/commit_checkpoint instead of just a vclock.
> > 
> > wal is a singleton and there could be only one ongoing checkpoint. 
> > 
> > I am ok with this change but I don't understand the purpose of it:
> > why not simply store wal_checkpoint in struct wal then you don't
> > have to pass it around at all?
> 
> Yeah, we could store the vclock in the WAL thread, but IMO that would
> look ugly, because the new member of the wal_writer struct would only be
> used during checkpointing and would be meaningless for the rest of the
> WAL operation.

OK, it's bikeshed.

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov




More information about the Tarantool-patches mailing list