[erlang-bugs] All keys in the same slot (Mnesia/dets)

Hans Bolinder hans.bolinder@REDACTED
Thu Jun 9 13:59:14 CEST 2011


Hi,

[Igor Ribeiro Sucupira:]
> The weirdest difference being that all records in uc_frag1004 are in
> the same slot!
> 
> 9> length([S || S <- lists:seq(0, element(2, dets:info(F1004,
>    no_slots)) - 1), length(dets:slot(F1004, S)) > 0]).
> 1

If you still have the file available: How many objects are there in
the slot? How many objects does a traversal of the file return? Try

  length(dets:match_object(F1004,'_')).

If the numbers differ then the file is corrupt.

> Is there a way to manually raise the number of slots in a dets table?

You can try closing the file, and then force a repair:

  dets:open_file(T, [{min_no_slots,N},{repair,force}]).

where N is some suitable integer.

Best regards,

Hans Bolinder, Erlang/OTP team, Ericsson



More information about the erlang-bugs mailing list