On Thursday, June 13, 2019 5:17:02 PM MSK Vladimir Davydov wrote: > On Sun, Jun 09, 2019 at 11:44:36PM +0300, Georgy Kirichenko wrote: > > Use a fiber_cond to signal a condition and wake up a waiting fiber. > > This relaxes friction between fiber and transaction life cycles. > > I don't see how it relaxes anything ;-) > > Please be more specific when writing comments. Oh, thanks, I will do it > > > + > > 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. > > Anyway, I have my reservations re how you handle WAL writer wakeups. > Please see my comments to the final patch.