Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@dev.tarantool.org, gorcunov@gmail.com,
	korablev@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 3/3] box: remove is_local_recovery variable
Date: Fri, 2 Apr 2021 14:47:27 +0300	[thread overview]
Message-ID: <87bd277d-f396-5354-b472-3c3ceecc8c4b@tarantool.org> (raw)
In-Reply-To: <399ad30c78b2767cc6fe14e0f3b42045e0334216.1617315744.git.v.shpilevoy@tarantool.org>

Hi! Thanks for the patch!

02.04.2021 01:23, Vladislav Shpilevoy пишет:
> It was used so as to recover synchronous auto-commit transactions
> in an async way (not blocking the fiber). But it became not
> necessary since #5874 was fixed. Because recovery does not use
> auto-commit transactions anymore.
>
> Closes #5194
> ---
>   src/box/box.cc | 12 +-----------
>   1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/src/box/box.cc b/src/box/box.cc
> index f70a2bd0e..8eacbfebb 100644
> --- a/src/box/box.cc
> +++ b/src/box/box.cc
> @@ -125,8 +125,6 @@ static struct gc_checkpoint_ref backup_gc;
>   static bool is_box_configured = false;
>   static bool is_ro = true;
>   static fiber_cond ro_cond;
> -/** Set to true during recovery from local files. */
> -static bool is_local_recovery = false;
>   
>   /**
>    * The following flag is set if the instance failed to
> @@ -241,7 +239,6 @@ box_process_rw(struct request *request, struct space *space,
>   		goto rollback;
>   
>   	if (is_autocommit) {
> -		int res = 0;
>   		/*
>   		 * During local recovery the commit procedure
>   		 * should be async, otherwise the only fiber
> @@ -253,12 +250,7 @@ box_process_rw(struct request *request, struct space *space,
>   		 * all during local recovery, since journal_write
>   		 * is faked at this stage and returns immediately.
>   		 */

The comment above doesn't belong here anymore.
I propose you move it to `wal_stream_apply_dml_row`, where 
txn_commit_try_async()
is called now.

LGTM otherwise.

> -		if (is_local_recovery) {
> -			res = txn_commit_try_async(txn);
> -		} else {
> -			res = txn_commit(txn);
> -		}
> -		if (res < 0)
> +		if (txn_commit(txn) < 0)
>   			goto error;
>   	        fiber_gc();
>   	}
> @@ -3037,7 +3029,6 @@ local_recovery(const struct tt_uuid *instance_uuid,
>   	memtx = (struct memtx_engine *)engine_by_name("memtx");
>   	assert(memtx != NULL);
>   
> -	is_local_recovery = true;
>   	recovery_journal_create(&recovery->vclock);
>   
>   	/*
> @@ -3096,7 +3087,6 @@ local_recovery(const struct tt_uuid *instance_uuid,
>   	}
>   	stream_guard.is_active = false;
>   	recovery_finalize(recovery);
> -	is_local_recovery = false;
>   
>   	/*
>   	 * We must enable WAL before finalizing engine recovery,

-- 
Serge Petrenko


  reply	other threads:[~2021-04-02 11:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01 22:23 [Tarantool-patches] [PATCH 0/3] Transactional recovery Vladislav Shpilevoy via Tarantool-patches
2021-04-01 22:23 ` [Tarantool-patches] [PATCH 1/3] vinyl: handle multi-statement recovery txns Vladislav Shpilevoy via Tarantool-patches
2021-04-02  9:24   ` Serge Petrenko via Tarantool-patches
2021-04-01 22:23 ` [Tarantool-patches] [PATCH 2/3] recovery: make it transactional Vladislav Shpilevoy via Tarantool-patches
2021-04-02 11:47   ` Serge Petrenko via Tarantool-patches
2021-04-03 13:18     ` Vladislav Shpilevoy via Tarantool-patches
2021-04-05  8:36       ` Serge Petrenko via Tarantool-patches
2021-04-02 15:11   ` Cyrill Gorcunov via Tarantool-patches
2021-04-01 22:23 ` [Tarantool-patches] [PATCH 3/3] box: remove is_local_recovery variable Vladislav Shpilevoy via Tarantool-patches
2021-04-02 11:47   ` Serge Petrenko via Tarantool-patches [this message]
2021-04-03 13:18     ` Vladislav Shpilevoy via Tarantool-patches
2021-04-05  8:17       ` Serge Petrenko via Tarantool-patches
2021-04-02  9:42 ` [Tarantool-patches] [PATCH 0/3] Transactional recovery Konstantin Osipov via Tarantool-patches
2021-04-05 16:14 ` Kirill Yukhin via Tarantool-patches

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=87bd277d-f396-5354-b472-3c3ceecc8c4b@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=korablev@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 3/3] box: remove is_local_recovery variable' \
    /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