From: Cyrill Gorcunov <gorcunov@gmail.com> To: tml <tarantool-patches@dev.tarantool.org> Subject: [Tarantool-patches] [PATCH 17/17] relay: use _xc recovery helpers Date: Tue, 28 Apr 2020 19:11:37 +0300 [thread overview] Message-ID: <20200428161137.20536-18-gorcunov@gmail.com> (raw) In-Reply-To: <20200428161137.20536-1-gorcunov@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> --- src/box/relay.cc | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/box/relay.cc b/src/box/relay.cc index a5bcd9580..b6be3c0bd 100644 --- a/src/box/relay.cc +++ b/src/box/relay.cc @@ -341,10 +341,8 @@ relay_final_join_f(va_list ap) /* Send all WALs until stop_vclock */ assert(relay->stream.write != NULL); - if (recover_remaining_wals(relay->r, &relay->stream, - &relay->stop_vclock, true) != 0) { - diag_raise(); - } + recover_remaining_wals_xc(relay->r, &relay->stream, + &relay->stop_vclock, true); assert(vclock_compare(&relay->r->vclock, &relay->stop_vclock) == 0); return 0; } @@ -363,9 +361,7 @@ relay_final_join(int fd, uint64_t sync, struct vclock *start_vclock, relay_delete(relay); }); - relay->r = recovery_new(cfg_gets("wal_dir"), false, start_vclock); - if (relay->r == NULL) - diag_raise(); + relay->r = recovery_new_xc(cfg_gets("wal_dir"), false, start_vclock); vclock_copy(&relay->stop_vclock, stop_vclock); @@ -504,10 +500,7 @@ relay_process_wal_event(struct wal_watcher *watcher, unsigned events) } try { bool scan_dir = (events & WAL_EVENT_ROTATE) ? true : false; - if (recover_remaining_wals(relay->r, &relay->stream, NULL, - scan_dir) != 0) { - diag_raise(); - } + recover_remaining_wals_xc(relay->r, &relay->stream, NULL, scan_dir); } catch (Exception *e) { relay_set_error(relay, e); fiber_cancel(fiber()); @@ -719,9 +712,7 @@ relay_subscribe(struct replica *replica, int fd, uint64_t sync, }); vclock_copy(&relay->local_vclock_at_subscribe, &replicaset.vclock); - relay->r = recovery_new(cfg_gets("wal_dir"), false, replica_clock); - if (relay->r == NULL) - diag_raise(); + relay->r = recovery_new_xc(cfg_gets("wal_dir"), false, replica_clock); vclock_copy(&relay->tx.vclock, replica_clock); relay->version_id = replica_version_id; -- 2.20.1
next prev parent reply other threads:[~2020-04-28 16:15 UTC|newest] Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-28 16:11 [Tarantool-patches] [PATCH 00/17] recovery: move from cxx to c code Cyrill Gorcunov 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 01/17] recovery: do not call recovery_stop_local inside recovery_delete Cyrill Gorcunov 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 02/17] recovery: convert WalSubscription class to structure Cyrill Gorcunov 2020-05-03 18:42 ` Vladislav Shpilevoy 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 03/17] recovery: recovery_close_log -- don't throw exception Cyrill Gorcunov 2020-05-03 18:43 ` Vladislav Shpilevoy 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 04/17] recovery: recovery_open_log " Cyrill Gorcunov 2020-05-03 18:43 ` Vladislav Shpilevoy 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 05/17] recovery: recover_xlog " Cyrill Gorcunov 2020-05-03 18:44 ` Vladislav Shpilevoy 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 06/17] recovery: recover_remaining_wals " Cyrill Gorcunov 2020-05-03 18:44 ` Vladislav Shpilevoy 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 07/17] recovery: hot_standby_f " Cyrill Gorcunov 2020-05-03 18:45 ` Vladislav Shpilevoy 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 08/17] recovery: recovery_follow_local " Cyrill Gorcunov 2020-05-03 18:46 ` Vladislav Shpilevoy 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 09/17] recovery: recovery_new " Cyrill Gorcunov 2020-05-03 18:47 ` Vladislav Shpilevoy 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 10/17] recovery: recovery_scan " Cyrill Gorcunov 2020-05-03 18:47 ` Vladislav Shpilevoy 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 11/17] recovery: recovery_finalize " Cyrill Gorcunov 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 12/17] recovery: recovery_stop_local " Cyrill Gorcunov 2020-05-03 18:47 ` Vladislav Shpilevoy 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 13/17] recovery: cxx to c transition Cyrill Gorcunov 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 14/17] recovery: drop redundant type_XlogGapError Cyrill Gorcunov 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 15/17] recovery: provide throwable wrappers Cyrill Gorcunov 2020-04-28 16:11 ` [Tarantool-patches] [PATCH 16/17] box: use _xc helpers of recovery code Cyrill Gorcunov 2020-05-03 18:47 ` Vladislav Shpilevoy 2020-04-28 16:11 ` Cyrill Gorcunov [this message] 2020-04-28 16:24 ` [Tarantool-patches] [PATCH 01/17] recovery: do not call recovery_stop_local inside recovery_delete Cyrill Gorcunov
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=20200428161137.20536-18-gorcunov@gmail.com \ --to=gorcunov@gmail.com \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 17/17] relay: use _xc recovery helpers' \ /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