~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/mnesia/src/mnesia_recover.erl

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
%%
2
2
%% %CopyrightBegin%
3
 
%% 
4
 
%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
5
 
%% 
 
3
%%
 
4
%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
 
5
%%
6
6
%% The contents of this file are subject to the Erlang Public License,
7
7
%% Version 1.1, (the "License"); you may not use this file except in
8
8
%% compliance with the License. You should have received a copy of the
9
9
%% Erlang Public License along with this software. If not, it can be
10
10
%% retrieved online at http://www.erlang.org/.
11
 
%% 
 
11
%%
12
12
%% Software distributed under the License is distributed on an "AS IS"
13
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
14
%% the License for the specific language governing rights and limitations
15
15
%% under the License.
16
 
%% 
 
16
%%
17
17
%% %CopyrightEnd%
18
18
%%
19
19
 
36
36
         incr_trans_tid_serial/0,
37
37
         init/0,
38
38
         log_decision/1,
 
39
         log_dump_overload/1,
39
40
         log_master_nodes/3,
40
41
         log_mnesia_down/1,
41
42
         log_mnesia_up/1,
61
62
         code_change/3
62
63
        ]).
63
64
 
 
65
-compile({no_auto_import,[error/2]}).
64
66
 
65
67
-include("mnesia.hrl").
66
68
-import(mnesia_lib, [set/2, verbose/2, error/2, fatal/2]).
70
72
                unclear_decision,
71
73
                unclear_waitfor,
72
74
                tm_queue_len = 0,
 
75
                log_dump_overload = false,
73
76
                initiated = false,
74
77
                early_msgs = []
75
78
               }).
277
280
            cast({mnesia_down, Node})
278
281
    end.
279
282
 
 
283
log_dump_overload(Flag) when is_boolean(Flag) ->
 
284
    cast({log_dump_overload, Flag}).
 
285
 
280
286
log_master_nodes(Args, UseDir, IsRunning) ->
281
287
    if
282
288
        IsRunning == yes ->
818
824
    announce_all(Nodes),
819
825
    {noreply, State};
820
826
 
 
827
handle_cast({log_dump_overload, Flag}, State) when is_boolean(Flag) ->
 
828
    Prev = State#state.log_dump_overload,
 
829
    Overload = Prev orelse Flag,
 
830
    mnesia_lib:overload_set(mnesia_dump_log, Overload),
 
831
    {noreply, State#state{log_dump_overload = Flag}};
 
832
 
821
833
handle_cast(Msg, State) ->
822
834
    error("~p got unexpected cast: ~p~n", [?MODULE, Msg]),
823
835
    {noreply, State}.
851
863
                Len > Threshold, Prev > Threshold ->
852
864
                    What = {mnesia_tm, message_queue_len, [Prev, Len]},
853
865
                    mnesia_lib:report_system_event({mnesia_overload, What}),
 
866
                    mnesia_lib:overload_set(mnesia_tm, true),
854
867
                    {noreply, S#state{tm_queue_len = 0}};
855
868
                
856
869
                Len > Threshold ->
857
870
                    {noreply, S#state{tm_queue_len = Len}};
858
871
                
859
872
                true ->
 
873
                    mnesia_lib:overload_set(mnesia_tm, false),
860
874
                    {noreply, S#state{tm_queue_len = 0}}
861
875
            end;
862
876
        undefined ->
905
919
%% Purpose: Upgrade process when its code is to be changed
906
920
%% Returns: {ok, NewState}
907
921
%%----------------------------------------------------------------------
908
 
code_change(_OldVsn, State, _Extra) ->
 
922
code_change(_OldVsn, {state,
 
923
                      Supervisor,
 
924
                      Unclear_pid,
 
925
                      Unclear_decision,
 
926
                      Unclear_waitfor,
 
927
                      Tm_queue_len,
 
928
                      Initiated,
 
929
                      Early_msgs
 
930
                     }, _Extra) ->
 
931
    {ok, #state{supervisor = Supervisor,
 
932
                unclear_pid = Unclear_pid,
 
933
                unclear_decision = Unclear_decision,
 
934
                unclear_waitfor = Unclear_waitfor,
 
935
                tm_queue_len = Tm_queue_len,
 
936
                initiated = Initiated,
 
937
                early_msgs = Early_msgs}};
 
938
code_change(_OldVsn, #state{} = State, _Extra) ->
909
939
    {ok, State}.
910
940
 
911
941
%%%----------------------------------------------------------------------