~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
do_allow_garb() ->
104
104
    %% The order of the following stuff is important!
105
105
    Curr = val(latest_transient_decision),
106
 
    Old = val(previous_transient_decisions),
107
 
    Next = create_transient_decision(),
108
 
    {Prev, ReallyOld} = sublist([Curr | Old], 10, []),
109
 
    [?ets_delete_table(Tab) || Tab <- ReallyOld],
110
 
    set(previous_transient_decisions, Prev),
111
 
    set(latest_transient_decision, Next).
 
106
    %% Don't garb small tables, they are created on every 
 
107
    %% dump_log and may be small (empty) for schema transactions
 
108
    %% which are dumped twice
 
109
    case ets:info(Curr, size) > 20 of
 
110
        true ->
 
111
            Old = val(previous_transient_decisions),
 
112
            Next = create_transient_decision(),
 
113
            {Prev, ReallyOld} = sublist([Curr | Old], 10, []),
 
114
            [?ets_delete_table(Tab) || Tab <- ReallyOld],
 
115
            set(previous_transient_decisions, Prev),
 
116
            set(latest_transient_decision, Next);
 
117
        false ->
 
118
            ignore
 
119
    end.
112
120
    
113
121
sublist([H|R], N, Acc) when N > 0 ->
114
122
    sublist(R, N-1, [H| Acc]);