[tarantool-patches] Re: [PATCH v4 7/9] txn: introduce asynchronous txn commit

Konstantin Osipov kostja at tarantool.org
Thu Jun 20 11:01:15 MSK 2019


* Georgy Kirichenko <georgy at tarantool.org> [19/06/20 09:54]:
> +	txn->fiber = NULL;
> +	txn->done = false;
>  	/* fiber_on_yield/fiber_on_stop initialized by engine on demand */
>  	fiber_set_txn(fiber(), txn);
>  	trigger_create(&txn->fiber_on_stop, txn_on_stop, NULL, NULL);
> @@ -359,7 +362,11 @@ txn_complete(struct txn *txn)
>  			panic("rollback trigger failed");
>  		}
>  		fiber_set_txn(fiber(), NULL);
> -
> +		txn->done = true;
> +		if (txn->fiber == NULL)
> +			txn_free(txn);
> +		else if (txn->fiber != fiber())
> +			fiber_wakeup(txn->fiber);

I think if a journal entry allows multiple triggers, txn->fiber
could be moved to a trigger as well, so you don't need to extend
the fiber.

I like it that you only have a single trigger list -  fewer lists
to initialize. Unfortunately there are already two lists - commit
and rollback - iin the txn


-- 
Konstantin Osipov, Moscow, Russia




More information about the Tarantool-patches mailing list