From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id B67E84696CB for ; Tue, 28 Apr 2020 19:15:19 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id j3so22045446ljg.8 for ; Tue, 28 Apr 2020 09:15:19 -0700 (PDT) From: Cyrill Gorcunov Date: Tue, 28 Apr 2020 19:11:37 +0300 Message-Id: <20200428161137.20536-18-gorcunov@gmail.com> In-Reply-To: <20200428161137.20536-1-gorcunov@gmail.com> References: <20200428161137.20536-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 17/17] relay: use _xc recovery helpers List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Signed-off-by: Cyrill Gorcunov --- 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