File 0892-Fix-ERL-1227-mnesia_recover.patch of Package erlang

From 43ca74d960415cec52b301598b4b963bcafa89e3 Mon Sep 17 00:00:00 2001
From: zhangsiyang0629 <zhangsiyang0629@163.com>
Date: Sun, 26 Apr 2020 11:24:33 +0800
Subject: [PATCH] [Fix] ERL-1227: mnesia_recover

https://bugs.erlang.org/browse/ERL-1227?jql=text%20~%20%22mnesia%22

When a Mnesia node startup, it could not execute the transaction recovery process.
The transaction recovery process entry is in mnesia_recover.erl file, but never called
when a Mnesia node startup. This commit fix the bug.
---
 lib/mnesia/src/mnesia_recover.erl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/mnesia/src/mnesia_recover.erl b/lib/mnesia/src/mnesia_recover.erl
index 2ccea1ea6d..8749b625a1 100644
--- a/lib/mnesia/src/mnesia_recover.erl
+++ b/lib/mnesia/src/mnesia_recover.erl
@@ -449,6 +449,9 @@ wait_for_decision(D, InitBy, N) ->
     if 
 	Outcome =:= committed -> {Tid, committed};
 	Outcome =:= aborted   -> {Tid, aborted};
+	InitBy == startup ->
+	    {ok, Res} = call({wait_for_decision, D}),
+	    {Tid, Res};
 	Outcome =:= presume_abort -> 
 	    case N > Max of
 		true -> {Tid, aborted};
@@ -460,10 +463,7 @@ wait_for_decision(D, InitBy, N) ->
 	    %% Wait a while for active transactions
 	    %% to end and try again
 	    timer:sleep(100), 
-	    wait_for_decision(D, InitBy, N);
-	InitBy == startup ->
-	    {ok, Res} = call({wait_for_decision, D}),
-	    {Tid, Res}
+	    wait_for_decision(D, InitBy, N)
     end.
 
 still_pending([Tid | Pending]) ->
-- 
2.16.4

openSUSE Build Service is sponsored by