[tarantool-patches] [PATCH v3 07/14] wal: remove fiber from a journal_entry structure

Vladimir Davydov vdavydov.dev at gmail.com
Fri Jun 14 11:05:07 MSK 2019


On Thu, Jun 13, 2019 at 10:33:37PM +0300, Георгий Кириченко wrote:
> > Using a fiber_cond to wake up a single fiber is an overkill. You could
> > as well do
> > 
> > 	while (!entry->done)
> > 		fiber_yield_timeout(TIMEOUT_INFINITY);
> It is not even possible. In common case (an asynchronous transaction for 
> instance) WAL  doesn't know which fiber should be awaken and even does such 
> fiber exist. Please consider following case: an applier fired a transaction and 
> died. Transaction is finished and could be finalized in any fiber which possible 
> doesn't exist in this time. So the one way I see do handle this is to let fiber 
> subscribe on transaction done. If you could offer me with better solution I 
> would be happy.

It would be nice to see this reasoning in a comment to the code.

However, I don't quite agree. An applier fires async transactions, which
it doesn't really need to wait for, as we can free async transactions
right from the completion callback. To stop the applier on WAL error we
could use on_rollback trigger AFAICS.

Regarding sync transactions, we can make the fiber waiting for it to
complete non-cancellable, just like we do now.



More information about the Tarantool-patches mailing list