[erlang-questions] Iterate over fragmented table

Khitai Pang khitai.pang@REDACTED
Wed Dec 28 21:52:53 CET 2016


Hi,

Exception is thrown when using mnesia:foldl/3 to iterate over a 
fragmented table:

mnesia:foldl(Iterator, [], report_timestamp)

     exception throw: {badarg,
                          [{ets,match_object,
                               [5849148,
                                {{locks,report_timestamp_frag37,
                                     '______WHOLETABLE_____'},
                                 '_'}],
                               []},
                           {mnesia_locker,need_lock,4,
[{file,"mnesia_locker.erl"},{line,882}]},
                           {mnesia_locker,rlock,3,
[{file,"mnesia_locker.erl"},{line,1036}]},
                           {mnesia,init_iteration,4,
                               [{file,"mnesia.erl"},{line,1042}]},
{mnesia,foldl,6,[{file,"mnesia.erl"},{line,969}]},
{lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
                           {mnesia_tm,apply_fun,3,
                               [{file,"mnesia_tm.erl"},{line,836}]},
                           {mnesia_tm,execute_transaction,5,
                               [{file,"mnesia_tm.erl"},{line,811}]}]}


Why is this happening?  Is this the correct way to iterate over a 
fragmented table?

Erlang version is 19.2.


Thanks
Khitai


More information about the erlang-questions mailing list