From 00a9977eb0638b6cb8b768f8b76413ad74c1f502 Mon Sep 17 00:00:00 2001
From: Vladimir Davydov <vdavydov@tarantool.org>
Date: Thu, 30 Jun 2022 15:14:38 +0300
Subject: [PATCH] hot_standby: log error if hot standby fails to apply row

Since commit d2537d9dae15 ("relay: cleanup error handling")
recover_remaining_wals() doesn't log the error it throws -
now callers of this function should catch and log the error.
hot_standby_f() doesn't catch the error so the diagnostic
message is lost if we fail to apply a row in the hot standby
mode. Fix this.

NO_DOC=bug fix
NO_TEST=checked in next commit
NO_CHANGELOG=minor bug in logging
---
 src/box/recovery.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/box/recovery.cc b/src/box/recovery.cc
index 331164ced5..a596e9d095 100644
--- a/src/box/recovery.cc
+++ b/src/box/recovery.cc
@@ -483,9 +483,12 @@ hot_standby_f(va_list ap)
 		int64_t start, end;
 		do {
 			start = vclock_sum(&r->vclock);
-
-			recover_remaining_wals(r, stream, NULL, scan_dir);
-
+			try {
+				recover_remaining_wals(r, stream, NULL,
+						       scan_dir);
+			} catch (Exception *e) {
+				e->log();
+			}
 			end = vclock_sum(&r->vclock);
 			/*
 			 * Continue, given there's been progress *and* there is a
-- 
GitLab