[Tarantool-patches] [PATCH v3 06/13] txm: add TX status

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Jul 16 03:08:00 MSK 2020


Thanks for the patch!

Firstly, I agree with all comments from Nikita.

> diff --git a/src/box/txn.h b/src/box/txn.h
> index 36b1a03..e261852 100644
> --- a/src/box/txn.h
> +++ b/src/box/txn.h
> @@ -121,6 +121,40 @@ enum {
>  };
>  
>  /**
> + * Status of a transaction.
> + */
> +enum txn_status {
> +	/**
> +	 * Initial state of TX. The only state of a TX that allowed to do

Lets follow the code style and keep the comments in 66 symbols
border. In this commit and in all the others.

> +	 * read or write actions.
> +	 */
> +	TXN_INPROGRESS,
> +	/**
> +	 * The TX have passed conflict checks and is ready to be committed.
> +	 */
> +	TXN_PREPARED,
> +	/**
> +	 * The TX was aborted when other TX was committed due to conflict.
> +	 */
> +	TXN_CONFLICTED,
> +	/**
> +	 * The TX was read_only, has a conflict and was sent to read view.
> +	 * Read-only and does not participate in conflict resolution ever more.
> +	 * This transaction can onlu see state of the database at some fixed
> +	 * point in the past.
> +	 */
> +	TXN_IN_READ_VIEW,
> +	/**
> +	 * The TX was committed.
> +	 */
> +	TXN_COMMITTED,
> +	/**
> +	 * The TX was aborted by user.
> +	 */
> +	TXN_ABORTED,
> +};

I started a ticket for follow-up optimisations. I suggest to collect all of
them here: https://github.com/tarantool/tarantool/issues/5172. The ones
which are trivial and don't need separate tickets.


More information about the Tarantool-patches mailing list