[tarantool-patches] Re: [PATCH 10/10] vinyl: get rid of the latch protecting vylog buffer

Konstantin Osipov kostja at tarantool.org
Sat Jun 1 11:44:36 MSK 2019


* Vladimir Davydov <vdavydov.dev at gmail.com> [19/05/17 17:54]:
> The latch is needed solely to synchronize access to the transaction
> write buffer, which is shared by all transactions. We don't need it to
> sync vylog readers vs writers as everything is done from the same
> thread. So to get rid of the latch, which is a prerequisite for
> transactional DDL, as it makes even simply Vinyl DDL operations
> yielding, we need to rework the buffer management.
> 
> To achieve that, this patch introduces a separate object for each vylog
> transaction, which stores the list of records to be committed. Once a
> transaction is ready to be committed, it is sent to the vylog thread,
> which writes it to vylog and then wakes up the awaiting fiber. For
> non-discardable transactions, it doesn't wakeup any fiber, the fiber
> returns immediately and the transaction is freed automatically.
> 
> To allow that, transactions are now allocated on lsregion, which acts
> as a queue: new transactions are appended to the tail, committed
> transactions are popped from the head.

The same could be achieved with xlog savepoints that you
introduced earlier, if you allow multiple "savepoints" to be present 
in xlog tx, each of which could be rolled back independently (the
tail of the buffer would have to be moved on rollback).

I mean, honestly, if we're getting rid of the latch, there is no
point of having adding a separate thread on the way, it just takes
a little extra effort. And better yet, we could kill entire vy_log
altogether and store everything in xlog.

-- 
Konstantin Osipov, Moscow, Russia




More information about the Tarantool-patches mailing list