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: Mon, 5 Apr 2021 11:17:57 +0300 [thread overview] Message-ID: <e5e707d7-844e-13f0-4c55-b771a69bd275@tarantool.org> (raw) In-Reply-To: <b1b68fcd-dabe-bfab-d3c8-9f148a88bcf2@tarantool.org> 03.04.2021 16:18, Vladislav Shpilevoy пишет: > Thanks for the review! > >>> @@ -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. > Yeah, I totally forgot about this comment. Moved to try_async in recovery > in the previous commit. Thanks for the fixes! LGTM. > The full patch: > > ==================== > diff --git a/src/box/box.cc b/src/box/box.cc > index 67b44c053..fa8a254f9 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,24 +239,7 @@ 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 > - * processing recovery will get stuck on the first > - * synchronous tx it meets until confirm timeout > - * is reached and the tx is rolled back, yielding > - * an error. > - * Moreover, txn_commit_try_async() doesn't hurt at > - * all during local recovery, since journal_write > - * is faked at this stage and returns immediately. > - */ > - 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(); > } > @@ -3068,7 +3049,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); > > /* > @@ -3127,7 +3107,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
next prev parent reply other threads:[~2021-04-05 8:18 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 2021-04-03 13:18 ` Vladislav Shpilevoy via Tarantool-patches 2021-04-05 8:17 ` Serge Petrenko via Tarantool-patches [this message] 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=e5e707d7-844e-13f0-4c55-b771a69bd275@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