[Tarantool-patches] [PATCH 11/17] recovery: recovery_finalize -- don't throw exception

Cyrill Gorcunov gorcunov at gmail.com
Tue Apr 28 19:11:31 MSK 2020


Prepare for transition to plain C.

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 src/box/box.cc      | 4 +++-
 src/box/recovery.cc | 5 ++---
 src/box/recovery.h  | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/box/box.cc b/src/box/box.cc
index c269a5da8..31c53a443 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -2318,7 +2318,9 @@ local_recovery(const struct tt_uuid *instance_uuid,
 		box_listen();
 		box_sync_replication(false);
 	}
-	recovery_finalize(recovery);
+
+	if (recovery_finalize(recovery) != 0)
+		diag_raise();
 
 	/*
 	 * We must enable WAL before finalizing engine recovery,
diff --git a/src/box/recovery.cc b/src/box/recovery.cc
index af7910bdf..9ed42590c 100644
--- a/src/box/recovery.cc
+++ b/src/box/recovery.cc
@@ -389,11 +389,10 @@ recover_remaining_wals(struct recovery *r, struct xstream *stream,
 	return 0;
 }
 
-void
+int
 recovery_finalize(struct recovery *r)
 {
-	if (recovery_close_log(r) != 0)
-		diag_raise();
+	return recovery_close_log(r);
 }
 
 
diff --git a/src/box/recovery.h b/src/box/recovery.h
index 90fbf1b0a..a8cfa27d1 100644
--- a/src/box/recovery.h
+++ b/src/box/recovery.h
@@ -85,7 +85,7 @@ recovery_follow_local(struct recovery *r, struct xstream *stream,
 void
 recovery_stop_local(struct recovery *r);
 
-void
+int
 recovery_finalize(struct recovery *r);
 
 #if defined(__cplusplus)
-- 
2.20.1



More information about the Tarantool-patches mailing list