Commits

Anonymous committed 29b93aa

restart backend after hometest=not home

Comments (0)

Files changed (2)

apps/riak/src/riak_dets_backend.erl

     dets:info(T, size) =:= 0.
 
 drop(#state{table=T, path=P}) ->
-    ok = dets:delete_all_objects(T),
+    %ok = dets:delete_all_objects(T),
     ok = dets:close(T),
     ok = file:delete(P).
 

apps/riak/src/riak_vnode.erl

     case hometest(StateData0) of
         {next_state, StateName, StateData, Timeout} ->
             {ok, StateName, StateData, Timeout};
-        {stop,normal,_StateData} ->
-            {stop, normal}
-%            % always stick around for one timeout cycle
-%            {ok, active, StateData, ?TIMEOUT}
+        {stop,normal,StateData} ->
+%            {stop, normal}
+            % always stick around for one timeout cycle
+            % restart the backend as it may have deleted its data
+            {ok, ModState1} = Mod:start(VNodeIndex, Configuration),
+            {ok, active, StateData#state{mod=Mod, modstate=ModState1}, ?TIMEOUT}
     end.
 
 %% @private