## 1 Mnesia Release Notes

This document describes the changes made to the Mnesia system from version to version. The intention of this document is to list all incompatibilities as well as all enhancements and bugfixes for every release of Mnesia. Each release of Mnesia thus constitutes one section in this document. The title of each section is the version number of Mnesia.

### 1.1 Mnesia 4.0.2

#### 1.1.1 Improvements and new features

None

#### 1.1.2 Fixed Bugs and malfunctions

- Checkpoints could crash mnesia when mnesia nodes started.
  Own Id: OTP-4318
  Aux Id: seq7206
- Some schema operations could return {atomic, ok} but still fail to commit the operation on nodes with disc, e.g. transform_table.
  Own Id: OTP-4319
- Mnesia left disk_log files opened in some cases, which could lead to crashes.
  Own Id: OTP-4320
  Aux Id: seq7338
- `mnesia:transform_table` didn't work if table had indecies, it returned {atomic, ok} but the meta-data was not transformed.
  Own Id: OTP-4325
  Aux Id: seq7342
- Transform table on disc_copies tables, sometimes fail to store the transformed records to disc.
  Own Id: OTP-4292
- An empty (ram_copies table) file could be created when unpacking a fallback.
  Own Id: OTP-4338
- Removed a possibilty for getting inconsistent tables during table copying.
  Own Id: OTP-4338
- `mnesia:select/[2|3]` now works with fragmented tables.
  Own Id: OTP-4338

#### 1.1.3 Incompatibilities

None

#### 1.1.4 Known bugs and problems

None.

### 1.2 Mnesia 4.0.1

#### 1.2.1 Improvements and new features

None.

#### 1.2.2 Fixed Bugs and malfunctions

- Using `mnesia:dump_tables/1` or `mnesia:change_table_copy(Tab, Node, disc_copies)` on a ram node (schema in ram) causes a crash in earlier mnesia-3.10.* releases.
  Own Id: OTP-4187
  Aux Id: Seq 7188
- If a mnesia node was restarted during a checkpoint (also affects backups) the checkpoint would be trashed, which could lead to hangings, crashes and other undesired behaviours, including that the checkpoint could delete other applications ets tables.
  Own Id: OTP-4215
  Aux Id: Seq 7206 and probably Seq 7184, Seq 7151
- `mnesia:delete_object/[1|3]` sometimes failed to delete entries on `set` tables.
- `mnesia:select/[2|3]` now works with fragmented tables.

#### 1.2.3 Incompatibilities

Release mnesia-4.0 and later will only run OTP R8 and later.

#### 1.2.4 Known bugs and problems

None.

### 1.3 Mnesia 4.0

#### 1.3.1 Improvements and new features

- The function `mnesia:[dirty_]select/[2|3]` has been added, the function can and should be used to write complex queries.
- The function `mnesia:sync_transaction/[1|2|3]` has been added, the function can be used to avoid overloading mnesia on other nodes.
  Own Id: OTP-3481
  Aux Id: Seq 4362
- Mnesia's locker mechanism has been optimized, and it is now possible to acquire a sticky_write lock in `mnesia:read/3`.

#### 1.3.2 Fixed Bugs and malfunctions

None

#### 1.3.3 Incompatibilities

Release mnesia-4.0 and later will only run OTP R8 and later.

#### 1.3.4 Known bugs and problems

None.

### 1.4 Mnesia 3.10.2

#### 1.4.1 Improvements and new features

- The user supplied `fallback_error_function` now get's the dying `Node` name as an argument.
  Own Id: OTP-4127
  Aux Id: Seq 7160

#### 1.4.2 Fixed Bugs and malfunctions

None

#### 1.4.3 Incompatibilities

None

#### 1.4.4 Known bugs and problems

None.

### 1.5 Mnesia 3.10.1

#### 1.5.1 Improvements and new features

None.

#### 1.5.2 Fixed Bugs and malfunctions

- Mnesia didn't remove buffered messages from dead nodes, which could lead to that mnesia hanged if a mnesia went down on another node during early startup.
  Own Id: OTP-4102
  Aux Id: Seq 7119
- Mnesia (3.10.0) could crash during restart if it the logs contained an update_counter operation.
  Own Id: OTP-4097
  Aux Id: Seq 7125

#### 1.5.3 Incompatibilities

None

#### 1.5.4 Known bugs and problems

None.

### 1.6 Mnesia 3.10.0

#### 1.6.1 Improvements and new features

- Speed/load improvements `disc_copies` tables are not implemented with `dets` anymore.
  Own Id: OTP-3712
  Aux Id: Seq 4910

#### 1.6.2 Fixed Bugs and malfunctions

- Removed references to dead nodes in loader queue, which could lead to system wide hangings, if a node goes down and another node has a reference to it in it's queue.

#### 1.6.3 Incompatibilities

Mnesia can't be upgraded on the fly, it has to be restarted.

#### 1.6.4 Known bugs and problems

None.

### 1.7 Mnesia 3.9.5

#### 1.7.1 Improvements and new features

- `mnesia:clear_table/1` is documented.
  Own Id: OTP-3956

#### 1.7.2 Fixed Bugs and malfunctions

- `mnesia:force_load_table/1` didn't check if the table was already loaded and could crash mnesia if table was deleted during execution.
  Own Id: OTP-3957

#### 1.7.3 Incompatibilities

None.

#### 1.7.4 Known bugs and problems

None.

### 1.8 Mnesia 3.9.4

#### 1.8.1 Improvements and new features

- `transform_table` now allows only meta-data transforms.
  Own Id: OTP-3878
  Aux Id: Seq 5057

#### 1.8.2 Fixed Bugs and malfunctions

- `mnesia:table_info(Tab, type)` performance on R7B has been improved.
  Own Id: OTP-3837
- Documentation referred to the non exiting function mnesia:delete_table/2.
  Own Id: OTP-3778
  Aux Id: Seq 5005
- `mnesia:all_keys/1` failed when using fragmented tables and keys of list types.
  Own Id: OTP-3779
  Aux Id: Seq 5006
- Fixed a bug in `mnesia:fold[lr]` functions. Records with lists as the Key field failed to show up in fold functions if they where written in the same transaction.
  Own Id: OTP-3893

#### 1.8.3 Incompatibilities

None.

#### 1.8.4 Known bugs and problems

None.

### 1.9 Mnesia 3.9.3

#### 1.9.1 Improvements and new features

- `transform_table` now supports indexes, but the dirty_index_* operations may exit when the index is rebuilt. The memory usage has been improved for `set` and `ordered_set` tables.
  Own Id: OTP-3762, OTP-3584
  Aux Id: Seq 4573
- New iteration functions has been added i.e. `foldl/3 foldr/3 foldl/4 foldr/4`, together with `dirty_last/1` and `dirty_prev/2` for `ordered_set` tables.
  Own Id: OTP-3761

#### 1.9.2 Fixed Bugs and malfunctions

- A timing issue during startup has been fixed, in the worst case records written on one node fails to show up on some nodes.

#### 1.9.3 Incompatibilities

None.

#### 1.9.4 Known bugs and problems

None.

### 1.10 Mnesia 3.9.2

#### 1.10.1 Improvements and new features

- Access to non-local tables avoids disc_only_replicas is possible.

#### 1.10.2 Fixed Bugs and malfunctions

- Sometimes `dirty_read` fails during brutal kill of replicated node, this is a synchronization problem. Mnesia now behaves better but can still fail in worst case, use transactions if this behavior is not acceptable.
  Own Id: OTP-3585.
  Aux Id: Seq 4574
- A delete followed by a write in a transaction failed to show up in `bag` tables.
- Removed a possibility for mnesia to hang on every node if mnesia crashed on one node during startup.
- Removed a deadlock possibility when using table locks.

#### 1.10.3 Incompatibilities

None.

#### 1.10.4 Known bugs and problems

None.

### 1.11 Mnesia 3.9.1

#### 1.11.1 Improvements and new features

None

#### 1.11.2 Fixed Bugs and malfunctions

- Mnesia could crash during startup on ram nodes, due to a race condition.
  Own Id: OTP-3557.
  Aux Id: Seq 4512

#### 1.11.3 Incompatibilities

None.

#### 1.11.4 Known bugs and problems

None.

### 1.12 Mnesia 3.9

#### 1.12.1 Improvements and new features

- A new configuration parameter `fallback_error_function` is introduced to let the user handle the case when mnesia have a fallback installed and and another mnesia goes down. The default behavior is as it always been to kill it self to avoid inconsistencies. The user can now start Erlang with `-mnesia fallback_error_function '{UserMod, UserFunc}'`.
  Own Id: OTP-3539, OTP-3057
  Aux Id: Seq 4476, Seq 1590, Seq 3809

#### 1.12.2 Fixed Bugs and malfunctions

- In earlier releases when mnesia reported `inconsistent_database` the only way to make it stop was to restart mnesia from a backup. To allow the usage of `master_nodes` settings, mnesia now checks if master_nodes (on the schema table) is set before reporting the inconsistency event. If set the event will not be reported.
  Own Id: OTP-3551
  Aux Id: Seq 4491
- If a logfile is very corrupted and disk_log fails to recognize the file as a log_file, mnesia fails to handle the case properly.
  Own Id: OTP-3545
  Aux Id: Seq 4492
- Mnesia table copy mechanism was not stable if the Erlang distribution went down and instantly up.
  Own Id: OTP-3544
  Aux Id: Seq 4493

#### 1.12.3 Incompatibilities

- The major version number change implies that mnesia-3.9 and later will not be able to talk with other mnesia nodes which are running mnesia-3.7.*.

#### 1.12.4 Known bugs and problems

None.

### 1.13 Mnesia 3.8.6

#### 1.13.1 Improvements and new features

None

#### 1.13.2 Fixed Bugs and malfunctions

- Mnesia could crash when sending a table to another node.
  Own Id: OTP-3517.

#### 1.13.3 Incompatibilities

None.

#### 1.13.4 Known bugs and problems

None.

### 1.14 Mnesia 3.8.5

#### 1.14.1 Improvements and new features

None

#### 1.14.2 Fixed Bugs and malfunctions

- `mnesia:[dirty]all_keys` didn't work with ordered_set tables.
  Own Id: OTP-3467.
  Aux Id: Seq 4338

#### 1.14.3 Incompatibilities

None.

#### 1.14.4 Known bugs and problems

None.

### 1.15 Mnesia 3.8.4

#### 1.15.1 Improvements and new features

None

#### 1.15.2 Fixed Bugs and malfunctions

- `mnesia:[dirty][index]_match_object` didn't work in the latest release, with index and wild_cards.
  Own Id: OTP-3450.
  Aux Id: Seq 4312

#### 1.15.3 Incompatibilities

None.

#### 1.15.4 Known bugs and problems

None.

### 1.16 Mnesia 3.8.3

#### 1.16.1 Improvements and new features

- Subscriptions have been extended with a new more detailed event. The detailed variant is activated with `mnesia:subscribe({table, Tab, detailed}).` and the events look like {Operation, Table, Value, OldValues, Tid}.
  Own Id: OTP-3356
  Aux Id: Seq 4066

#### 1.16.2 Fixed Bugs and malfunctions

- Delete objects on snmp tables, didn't work in the mnesia-3.8 releases.
  Own Id: OTP-3436
  Aux Id: Seq 4289
- `mnesia:[dirty]index_match_object` didn't work if the key was bound or the table resided on another node.
  Own Id: OTP-3399
  Aux Id: Seq 4229
- A couple of locking bugs has been fixed. A deadlock could occur if more than two processes were involved and one process wanted a table lock and the other wanted read and write lock and a third process held the lock.
- `mnesia:read(Tab, Key, write)` could if the table was deleted during the operation return a list of nodes.
- An internal deadlock in mnesia was removed. It happened during the startup when mnesia tried to connect to another node. This has only occurred when we started several mnesia nodes on the same Free-BSD machine.
- `mnesia:dump_to_textfile` and `mnesia:load_textfile` didn't work with record_names.

#### 1.16.3 Incompatibilities

None.

#### 1.16.4 Known bugs and problems

- There is issue with dangling module pointers that makes it impossible to upgrade code on the fly for the module mnesia_monitor in all earlier mnesia releases, this has now been fixed so it should not be an issue in the coming releases.

### 1.17 Mnesia 3.8.2

#### 1.17.1 Improvements and new features

- Introduced `mnesia:transform_table/4` in order to make it possible to handle new record types in code upgrades.

#### 1.17.2 Fixed Bugs and malfunctions

- Mnesia on one node can fail to load a table if master_nodes is set to another node, and the other node loads the table from a third node. Force load on the first may hang forever.
  Own Id: OTP-3358.

#### 1.17.3 Incompatibilities

None.

#### 1.17.4 Known bugs and problems

None.

### 1.18 Mnesia 3.8.1

#### 1.18.1 Improvements and new features

None

#### 1.18.2 Fixed Bugs and malfunctions

- When using `mnesia:match_object` with partially unbound key (e.g. Key = {bar, {'_', foo}}), mnesia failed to detect that the key where unbound which could result in hanging transactions.
  Own Id: OTP-3342.
  Aux Id: Seq 4064.

#### 1.18.3 Incompatibilities

None.

#### 1.18.4 Known bugs and problems

None.

### 1.19 Mnesia 3.8

#### 1.19.1 Improvements and new features

- Some new backup features has been introduced. The `Args` argument to the functions: `mnesia:backup(Opaque,Args)` and `mnesia:backup_checkpoint(Name,Opaque,Args)` has now been extended to also allow a list of options as a complement to the old `Mod` atom.
  - Incremental backup, enables backup of recent updates of the database, avoiding a full backup. The `{incremental,PrevName}` option specifies the name of a previously activated checkpoint, which hopefully already has been backed up. All updates that has been performed between the activation of the `PrevName` checkpoint and the `Name` checkpoint will be included in the backup.
  - Decentralized backup, enables backup of local tables, avoiding transfer of records to a central backup coordinator node. The `{scope,local}` option will cause the `mnesia:backup_checkpoint(Name,Opaque,Args)` function to simply ignore tables on remote nodes. The `scope` argument defaults to `global`.
  - Selective backup, enables backup of a subset of the tables included in the checkpoint, avoiding creation of huge backup files. The `{tables,TabList}` option will cause the backup functions to simply ignore all other tables than the ones included in the `TabList`.
  - In order to select a customized `mnesia_backup` callback module, the option `{module,Mod}` is used.
  - The `ram_overrides_dump` option to `mnesia:activate_checkpoint` has been extended to also allow an explicit list of tables which should have the `ram_overrides_dump` semantics.
- It is now possible to remove a mnesia node, `mnesia:del_table_copy(schema, Node)` now completly removes the reference to the node `Node` when the node is down. All tables which only reside on that node will be removed.
  See also incompatibilities.
- Connection to other mnesia nodes can be done with `mnesia:change_config(extra_db_nodes, NodeList)`, after mnesia is started. It can be called from a node which uses disc schema to connect to new and empty ram nodes. Or it can be called from the new ram node to connect to an already existing mnesia cluster.
- The type `ordered_set` is now supported for `ram_copies` and `disc_copies` tables if it is supported by the Erlang runtime system, i.e. OTP R5 or later.

#### 1.19.2 Fixed Bugs and malfunctions

- `mnesia:create_schema/1` created a temporary file on the current directory. This turned out to be not so splendid, especially if no write access was granted to the current directory. Now the temporary file is created on the Mnesia directory.
- `mnesia:restore/2` did not work if someone had subscribed to a table involved in the restore.
  Own Id: OTP-3183.
  Aux Id: Seq 3633.
- `mnesia:transform_table/3` has been made more efficient, it still uses alot memory due to the fact that all records has to be logged to disk as a single transaction.
  own Id: OTP-3246.
  Aux Id: Seq 3840
- A flaw in the locking mechanism caused a big overhead for lock acquisition when a lot of locks where held by the same transaction, this has now been fixed.
- The snmp hooks have been changed to use snmp_index, this should make it faster and have a smaller memory footprint for snmp tables in OTP R5 and later.

#### 1.19.3 Incompatibilities

- `Mnesia` cannot be upgraded on the fly, it must be restarted with the new code, due to protocol changes.
  It should be sufficient to restart one `mnesia` node at the time. New functionality will not work until all nodes have been upgraded.
- In mnesia-3.7.2 the following recovery mechansim where introduced.
  Mnesia generated a core dump and intentionally stopped if the log files were corrupted and contained the wrong records. Now Mnesia will generate an error event and continue if possible. This behaviour may lead to inconsistent data but Mnesia will be alive.
  The statement above is only valid if configuration parameter `auto_repair` is set to `true` (default). If `auto_repair` is set to `false` mnesia will generate a fatal event and terminate.
- `mnesia:del_table_copy(schema, Node)` will only work if and only if mnesia on the node `Node` is NOT running. Before `mnesia:del_table_copy(schema, Node)` would only work if the node was running. This behavior made it impossible to remove a mnesia node when the hardware was malfunctioning.

#### 1.19.4 Known bugs and problems

None.

Copyright © 1991-2002 Ericsson Utvecklings AB