Migrate table encoding and type #11

Open
uwiger wants to merge 3 commits from uw-migration into master
Owner

Maybe it's just me, but I've managed to make the error a few times that I've created a table as a set only to later realize that it should have been an ordered_set.
Mnesia doesn't support changing this, and in mnesia_rocksdb, we have the added complication that the change may involve re-coding each object in the table.

This PR makes it possible to do this.
mnesia_rocksdb_admin:change_table_type/[3,4] allow for changing the table type between sext and ordered_set, and if need be, migrating the serialization of the data.
This can be done either synchronously or asynchronously, and the migration process is stored persistently in the admin metadata table, and can be resumed after restart.

mnesia_rocksdb_admin:migrate_encoding/[3,4] support doing the re-coding manually, but using the above wrapper is strongly recommended.

See the test/mnesia_rocksdb_migration_SUITE for examples of use.

Maybe it's just me, but I've managed to make the error a few times that I've created a table as a `set` only to later realize that it should have been an `ordered_set`. Mnesia doesn't support changing this, and in `mnesia_rocksdb`, we have the added complication that the change may involve re-coding each object in the table. This PR makes it possible to do this. `mnesia_rocksdb_admin:change_table_type/[3,4]` allow for changing the table type between `sext` and `ordered_set`, and if need be, migrating the serialization of the data. This can be done either synchronously or asynchronously, and the migration process is stored persistently in the admin metadata table, and can be resumed after restart. `mnesia_rocksdb_admin:migrate_encoding/[3,4]` support doing the re-coding manually, but using the above wrapper is strongly recommended. See the `test/mnesia_rocksdb_migration_SUITE` for examples of use.
uwiger added 3 commits 2026-08-11 02:43:58 +09:00
uwiger requested review from dimitar.p.ivanov 2026-08-11 02:43:58 +09:00
uwiger requested review from hans_sv 2026-08-11 02:43:58 +09:00
uwiger requested review from spivee 2026-08-11 02:43:58 +09:00
uwiger requested review from zxq9 2026-08-11 02:43:58 +09:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin uw-migration:uw-migration
git checkout uw-migration
Sign in to join this conversation.