From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (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 9B9874696C3 for ; Tue, 28 Apr 2020 19:24:48 +0300 (MSK) Received: by mail-lj1-f196.google.com with SMTP id l19so22131455lje.10 for ; Tue, 28 Apr 2020 09:24:48 -0700 (PDT) Date: Tue, 28 Apr 2020 19:24:45 +0300 From: Cyrill Gorcunov Message-ID: <20200428162445.GB25459@uranus> References: <20200428161137.20536-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200428161137.20536-1-gorcunov@gmail.com> Subject: [Tarantool-patches] [PATCH 01/17] recovery: do not call recovery_stop_local inside recovery_delete List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml From: Georgy Kirichenko Recovery stop local raises an exception in case of an recovery error so it is not safe to stop recovery inside recovery delete and guard inside local_recovery. So call recovery_stop_local manually. Part of #980, #3794 --- src/box/box.cc | 4 +++- src/box/recovery.cc | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/box/box.cc b/src/box/box.cc index c01b08613..1c6fa582c 100644 --- a/src/box/box.cc +++ b/src/box/box.cc @@ -2294,8 +2294,10 @@ local_recovery(const struct tt_uuid *instance_uuid, recovery_follow_local(recovery, &wal_stream.base, "hot_standby", cfg_getd("wal_dir_rescan_delay")); while (true) { - if (path_lock(cfg_gets("wal_dir"), &wal_dir_lock)) + if (path_lock(cfg_gets("wal_dir"), &wal_dir_lock)) { + recovery_stop_local(recovery); diag_raise(); + } if (wal_dir_lock >= 0) break; fiber_sleep(0.1); diff --git a/src/box/recovery.cc b/src/box/recovery.cc index d1a503cfc..1d0e80057 100644 --- a/src/box/recovery.cc +++ b/src/box/recovery.cc @@ -216,7 +216,7 @@ recovery_open_log(struct recovery *r, const struct vclock *vclock) void recovery_delete(struct recovery *r) { - recovery_stop_local(r); + assert(r->watcher == NULL); trigger_destroy(&r->on_close_log); xdir_destroy(&r->wal_dir); -- 2.20.1