Migrate table encoding and type #11
Reference in New Issue
Block a user
Delete Branch "uw-migration"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Maybe it's just me, but I've managed to make the error a few times that I've created a table as a
setonly to later realize that it should have been anordered_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 betweensextandordered_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_SUITEfor examples of use.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.