Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Serge Petrenko <sergepetrenko@tarantool.org>, gorcunov@gmail.com
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 4/4] txn_limbo: add ROLLBACK processing
Date: Fri, 26 Jun 2020 00:14:16 +0200	[thread overview]
Message-ID: <81acf9b0-5fca-7be5-cd27-73cf45edbb4a@tarantool.org> (raw)
In-Reply-To: <16c9d1ffb9d09bb2b2f206a23973e2734616c345.1592482315.git.sergepetrenko@tarantool.org>

> diff --git a/src/box/txn_limbo.c b/src/box/txn_limbo.c
> index a715a136e..c55f5bda1 100644
> --- a/src/box/txn_limbo.c
> +++ b/src/box/txn_limbo.c
> @@ -191,6 +244,38 @@ txn_limbo_read_confirm(struct txn_limbo *limbo, int64_t lsn)
> +void
> +txn_limbo_read_rollback(struct txn_limbo *limbo, int64_t lsn)
> +{
> +	assert(limbo->instance_id != REPLICA_ID_NIL &&
> +	       limbo->instance_id != instance_id);
> +	struct txn_limbo_entry *e, *tmp;
> +	rlist_foreach_entry_safe_reverse(e, &limbo->queue, in_queue, tmp) {
> +		if (e->lsn < lsn)
> +			break;

Shouldn't this be 'continue' instead of 'break'? As I understand rollback,
we need to find entry, *from* which all the entries will be rolled back.
Here it seems that if the oldest entry in the limbo (with the smallest LSN)
is smaller than rollback lsn, we just won't rollback anything.

> +		assert(e->txn->fiber == NULL);
> +		e->is_rollback = true;
> +		txn_limbo_pop(limbo, e);
> +		txn_clear_flag(e->txn, TXN_WAIT_ACK);
> +
> +		/* Rollback the transaction. */
> +		e->txn->signature = -1;
> +		txn_complete(e->txn);
> +	}
> +}

  parent reply	other threads:[~2020-06-25 22:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-18 12:13 [Tarantool-patches] [PATCH 0/4] sync replication: add rollback processing Serge Petrenko
2020-06-18 12:14 ` [Tarantool-patches] [PATCH 1/4] xrow: fix comment typo Serge Petrenko
2020-06-18 22:15   ` Vladislav Shpilevoy
2020-06-18 22:15   ` Vladislav Shpilevoy
2020-06-19 17:28     ` Serge Petrenko
2020-06-18 12:14 ` [Tarantool-patches] [PATCH 2/4] xrow: add ability to encode/decode ROLLBACK requests Serge Petrenko
2020-06-18 14:46   ` Cyrill Gorcunov
2020-06-19 17:30     ` Serge Petrenko
2020-06-18 12:14 ` [Tarantool-patches] [PATCH 3/4] txn_limbo: add timeout when waiting for acks Serge Petrenko
2020-06-18 12:14 ` [Tarantool-patches] [PATCH 4/4] txn_limbo: add ROLLBACK processing Serge Petrenko
2020-06-18 22:15   ` Vladislav Shpilevoy
2020-06-19 17:35     ` Serge Petrenko
2020-06-21 15:53       ` Vladislav Shpilevoy
2020-06-19 17:53   ` Serge Petrenko
2020-06-23  8:37   ` Serge Petrenko
2020-06-25 22:14   ` Vladislav Shpilevoy [this message]
2020-06-25 22:43     ` Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81acf9b0-5fca-7be5-cd27-73cf45edbb4a@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 4/4] txn_limbo: add ROLLBACK processing' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox