# Mnesia fragmentation of external storage (leveldb) tables?

**URL:** <https://erlangforums.com/t/mnesia-fragmentation-of-external-storage-leveldb-tables/6044>\
**Category:** Questions / Help\
**Tags:** mnesia\
**Created:** [October 12, 2026, 9:55am UTC](https://erlangforums.com/t/mnesia-fragmentation-of-external-storage-leveldb-tables/6044 "2026-10-12T09:55:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chlorophil](https://erlangforums.com/user_avatar/erlangforums.com/chlorophil/32/3248_2.png) [@Chlorophil](https://erlangforums.com/u/Chlorophil)\
**Post date:** [October 12, 2026, 9:55am UTC](https://erlangforums.com/t/mnesia-fragmentation-of-external-storage-leveldb-tables/6044/1 "2026-10-12T09:55:59Z")

</div>

Howdy all, it’s been a while!

Has anyone managed to use Mnesia fragmented tables with external storage tables? I’m currently using OTP 29.1.1 (erts-17.1, according to erlang:system\_info(system\_version).

I was playing around with mnesia\_eleveldb and created a table using leveldb\_copies as the storage type. I can read from and write to this table so it all appears to be correct.

I can turn on fragmentation for the table using the usual **mnesia:change\_table\_frag(mytable, {activate, []})** method and this doesn’t throw up any immediate issues. I can continue to write new records to and read new and existing records from a single-fragment “fragmented” leveldb\_copies table.

But when I attempt to add a fragment with the expected **mnesia:change\_table\_frag(mytable, {add\_frag, [node()]})** command on this table I am hit with a function\_clause error from within the depths of mnesia\_schema:

```erlang
** exception error: no match of right hand side value {aborted,
 {function_clause,
  [{mnesia_schema,'-verify_nodes/1-inlined-1-',
    [nonode@nohost],
    [{file,"mnesia_schema.erl"},{line,1250}]},
   {lists,foreach_1,2,[{file,"lists.erl"},{line,2641}]},
   {mnesia_schema,verify_nodes,1,
    [{file,"mnesia_schema.erl"},{line,1249}]},
   {mnesia_schema,assert_correct_cstruct,1,
    [{file,"mnesia_schema.erl"},{line,1107}]},
   {mnesia_schema,verify_cstruct,1,
    [{file,"mnesia_schema.erl"},{line,1023}]},
   {mnesia_schema,unsafe_make_create_table,1,
    [{file,"mnesia_schema.erl"},{line,1561}]},
   {mnesia_frag,make_add_frag,2,
    [{file,"mnesia_frag.erl"},{line,873}]},
   {mnesia_frag,make_multi_add_frag,2,
    [{file,"mnesia_frag.erl"},{line,820}]}]}}

```

Changing the storage type of the table to ram\_copies or disc\_copies instead of leveldb\_copies lets the above commands work, and I’m able to create however many fragments I like, as usual. As far as I can tell from looking at the mnesia\_frag.erl and mnesia\_schema.erl files it seems that external storage tables are supposed to be supported, so maybe I’m not setting the add\_frag options correctly for this table storage type?

Thanks,

Phil

---

<div class="post-metadata">

**Author:** ![rachelwilson](https://erlangforums.com/letter_avatar_proxy/v4/letter/r/8edcca/32.png) [@rachelwilson](https://erlangforums.com/u/rachelwilson)\
**Post date:** [October 16, 2026, 11:33am UTC](https://erlangforums.com/t/mnesia-fragmentation-of-external-storage-leveldb-tables/6044/2 "2026-10-16T11:33:31Z")

</div>

i suspect this one is a backend limitation rather than your call being wrong. the fact the exact same sequence works on ram\_copies and disc\_copies points that way, fragmentation was built around the built in storage types and eleveldb plugs in underneath that layer. most folks i have seen hit this end up sharding manually instead, a handful of separate leveldb tables and hash the key in your own code to pick one. not as neat as frag tables, but it avoids the schema code path that is falling over here.
