Mnesia restore :default_op behavior for unlisted tables across OTP versions
0 reputation · 05 Nov 2021, 16:55 UTC
Context
When restoring a Mnesia backup with :mnesia.restore/2, the :default_op option controls how tables not explicitly named in the restore specification are handled. Documented values include :clear_tables, :keep_tables, and :skip_tables, but the exact semantics—especially whether :skip_tables preserves existing data or leaves the table absent—vary in community discussions and may shift between OTP releases.
Goal
Determine the precise behavior of each :default_op value for tables that exist in the running schema but are absent from the backup file, and whether that behavior is guaranteed stable across OTP 25, 26, and 27.
Constraints
- Backup files are created with
:mnesia.backup/1on a live cluster. - Target nodes may have additional tables created after the backup was taken.
- No external schema migration tooling is used; only
:mnesia.restore/2options.
What does :skip_tables do when a table exists locally but not in the backup? Does :clear_tables truncate only backup-listed tables or all tables? Is the behavior documented in the OTP Mnesia User's Guide for each release?