[Tarantool-patches] [PATCH 01/10] box: recovery_journal_create -- set journal here
Konstantin Osipov
kostja.osipov at gmail.com
Sat Mar 7 00:27:07 MSK 2020
* Cyrill Gorcunov <gorcunov at gmail.com> [20/03/05 15:32]:
> Allows to eliminate code duplication.
Yet recovery_journal_create() now does two things - creates and
sets a journal.
Then the next step is to move the declaration of struct
recovery_journal to this function and make this declaration static?
static recovery_journal journal;
journal->vclock = v;
journal_set(&journal);
Anyway, this is unimportant, so lgtm.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
> ---
> src/box/box.cc | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/box/box.cc b/src/box/box.cc
> index 09dd67ab4..eb5931e37 100644
> --- a/src/box/box.cc
> +++ b/src/box/box.cc
> @@ -331,6 +331,7 @@ recovery_journal_create(struct recovery_journal *journal, struct vclock *v)
> {
> journal_create(&journal->base, recovery_journal_write, NULL);
> journal->vclock = v;
> + journal_set(&journal->base);
> }
>
> static void
> @@ -2055,7 +2056,6 @@ bootstrap_from_master(struct replica *master)
> engine_begin_final_recovery_xc();
> struct recovery_journal journal;
> recovery_journal_create(&journal, &replicaset.vclock);
> - journal_set(&journal.base);
>
> if (!replication_anon) {
> applier_resume_to_state(applier, APPLIER_JOINED,
> @@ -2221,7 +2221,6 @@ local_recovery(const struct tt_uuid *instance_uuid,
>
> struct recovery_journal journal;
> recovery_journal_create(&journal, &recovery->vclock);
> - journal_set(&journal.base);
>
> /*
> * We explicitly request memtx to recover its
--
Konstantin Osipov, Moscow, Russia
More information about the Tarantool-patches
mailing list