From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp44.i.mail.ru (smtp44.i.mail.ru [94.100.177.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 63284469710 for ; Sun, 3 May 2020 21:47:16 +0300 (MSK) References: <20200428161137.20536-1-gorcunov@gmail.com> <20200428161137.20536-11-gorcunov@gmail.com> From: Vladislav Shpilevoy Message-ID: <8aeb8544-a3d9-72cf-3652-eafe5c80528b@tarantool.org> Date: Sun, 3 May 2020 20:47:15 +0200 MIME-Version: 1.0 In-Reply-To: <20200428161137.20536-11-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 10/17] recovery: recovery_scan -- don't throw exception List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov , tml Thanks for the patch! See 2 comments below. > diff --git a/src/box/recovery.cc b/src/box/recovery.cc > index 1c7665f87..af7910bdf 100644 > --- a/src/box/recovery.cc > +++ b/src/box/recovery.cc > @@ -134,12 +135,19 @@ recovery_scan(struct recovery *r, struct vclock *end_vclock, > > /* Scan the last xlog to find end vclock. */ > struct xlog_cursor cursor; > - if (xdir_open_cursor(&r->wal_dir, vclock_sum(end_vclock), &cursor) != 0) > - return; > + if (xdir_open_cursor(&r->wal_dir, vclock_sum(end_vclock), &cursor) != 0) { 1. This becomes out of 80 symbols now. I propose to wrap '&cursor' on the next line. > + /* > + * FIXME: Why do we ignore errors?! 2. Since we are talking about this, we also skip xlog_cursor_next() returning -1 below. > + */ > + return 0; > + } > + > struct xrow_header row; > while (xlog_cursor_next(&cursor, &row, true) == 0) > vclock_follow_xrow(end_vclock, &row); > + > xlog_cursor_close(&cursor, false); > + return 0; > }