From ad6e765bcd4f35a282ef00e38ed9129f3a5c1d83 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Thu, 1 Sep 2016 14:32:27 +0200 Subject: doc: Correct errors introduced by Editorial changes Fix some older errors as well. --- lib/mnesia/doc/src/Mnesia_chap1.xml | 28 +-- lib/mnesia/doc/src/Mnesia_chap8.xml | 8 +- lib/mnesia/doc/src/Mnesia_overview.xml | 42 ++-- lib/mnesia/doc/src/mnesia.xml | 336 ++++++++++++++++---------------- lib/mnesia/doc/src/mnesia_frag_hash.xml | 12 +- lib/mnesia/doc/src/mnesia_registry.xml | 12 +- lib/mnesia/doc/src/part.xml | 2 +- lib/mnesia/doc/src/ref_man.xml | 2 +- 8 files changed, 221 insertions(+), 221 deletions(-) (limited to 'lib/mnesia/doc/src') diff --git a/lib/mnesia/doc/src/Mnesia_chap1.xml b/lib/mnesia/doc/src/Mnesia_chap1.xml index 9dfeb5efe4..035e934ed2 100644 --- a/lib/mnesia/doc/src/Mnesia_chap1.xml +++ b/lib/mnesia/doc/src/Mnesia_chap1.xml @@ -32,38 +32,38 @@ C Mnesia_chap1.xml -

The Mnesia application provides a heavy duty real-time +

The Mnesia application provides a heavy duty real-time distributed database.

Scope

This User's Guide describes how to - build Mnesia database applications, and how to integrate - and use the Mnesia database management system with + build Mnesia database applications, and how to integrate + and use the Mnesia database management system with OTP. Programming constructs are described, and numerous programming examples are included to illustrate the use of - Mnesia.

+ Mnesia.

This User's Guide is organized as follows:

Mnesia provides an introduction to - Mnesia. + Mnesia. Getting Started - introduces Mnesia with an example database. Examples + introduces Mnesia with an example database. Examples are included how to start an Erlang session, specify a - Mnesia database directory, initialize a database - schema, start Mnesia, and create tables. Initial + Mnesia database directory, initialize a database + schema, start Mnesia, and create tables. Initial prototyping of record definitions is also discussed. Build a Mnesia Database more formally describes the steps - introduced in the previous section, namely the Mnesia - functions that define a database schema, start Mnesia, + introduced in the previous section, namely the Mnesia + functions that define a database schema, start Mnesia, and create the required tables. Transactions and Other Access Contexts - describes the transactions properties that make Mnesia into + describes the transactions properties that make Mnesia into a fault tolerant, real-time distributed database management system. This section also describes the concept of locking to ensure consistency in tables, and "dirty @@ -76,16 +76,16 @@ features include indexing, checkpoints, distribution and fault tolerance, disc-less nodes, replication manipulation, local content tables, concurrency, and object-based programming in - Mnesia. + Mnesia. Mnesia System Information describes the files contained in the - Mnesia database directory, database configuration data, + Mnesia database directory, database configuration data, core and table dumps, as well as the important subject of backup, fall-back, and disaster recovery principles. Combine Mnesia with - SNMP is a short section that outlines Mnesia + SNMP is a short section that outlines Mnesia integrated with SNMP. Appendix A: Backup diff --git a/lib/mnesia/doc/src/Mnesia_chap8.xml b/lib/mnesia/doc/src/Mnesia_chap8.xml index f1a469e315..4a2eed84d7 100644 --- a/lib/mnesia/doc/src/Mnesia_chap8.xml +++ b/lib/mnesia/doc/src/Mnesia_chap8.xml @@ -51,11 +51,11 @@

All these approaches have different advantages and - disadvantages. Mnesia applications can easily be opened to + disadvantages. Mnesia applications can easily be opened to the SNMP protocol. A direct 1-to-1 mapping can be established - between Mnesia tables and SNMP tables. This means - that a Mnesia table can be configured to be both - a Mnesia table and an SNMP table. A number of functions to + between Mnesia tables and SNMP tables. This means + that a Mnesia table can be configured to be both + a Mnesia table and an SNMP table. A number of functions to control this behavior are described in the Reference Manual.

diff --git a/lib/mnesia/doc/src/Mnesia_overview.xml b/lib/mnesia/doc/src/Mnesia_overview.xml index d2d597b85d..63f2309284 100644 --- a/lib/mnesia/doc/src/Mnesia_overview.xml +++ b/lib/mnesia/doc/src/Mnesia_overview.xml @@ -39,14 +39,14 @@ high level of fault tolerance that is required in many nonstop systems, combined with requirements on the DBMS to run in the same address space as the application, have led us to implement a new - DBMS, called Mnesia.

-

Mnesia is implemented in, and tightly connected to Erlang. + DBMS, called Mnesia.

+

Mnesia is implemented in, and tightly connected to Erlang. It provides the functionality that is necessary for the implementation of fault tolerant telecommunications systems.

-

Mnesia is a multiuser distributed DBMS specially made for +

Mnesia is a multiuser distributed DBMS specially made for industrial telecommunications applications written in Erlang, which is also the intended target language. - Mnesia tries to address all the data + Mnesia tries to address all the data management issues required for typical telecommunications systems. It has a number of features that are not normally found in traditional databases.

@@ -54,7 +54,7 @@ from the features provided by traditional DBMSs. The applications now implemented in Erlang need a mixture of a broad range of features, which generally are not satisfied by traditional DBMSs. - Mnesia is designed with requirements like the following in + Mnesia is designed with requirements like the following in mind:

Fast real-time key/value lookup @@ -71,9 +71,9 @@ Complex objects -

Mnesia is designed with the typical data management problems - of telecommunications applications in mind. This sets Mnesia - apart from most other DBMS. Hence Mnesia +

Mnesia is designed with the typical data management problems + of telecommunications applications in mind. This sets Mnesia + apart from most other DBMS. Hence Mnesia combines many concepts found in traditional databases such as transactions and queries with concepts found in data management systems for telecommunications applications, for example:

@@ -86,7 +86,7 @@ suspending it. -

Mnesia is also interesting because of its tight coupling to +

Mnesia is also interesting because of its tight coupling to Erlang, thus almost turning Erlang into a database programming language. This has many benefits, the foremost is that the impedance mismatch between the data format used by the DBMS @@ -97,7 +97,7 @@ Mnesia Database Management System (DBMS)

Features -

Mnesia contains the following features that combine to +

Mnesia contains the following features that combine to produce a fault-tolerant, distributed DBMS written in Erlang:

@@ -118,7 +118,7 @@ functions can be called within one transaction. Several transactions can run concurrently, and their execution - is fully synchronized by the DBMS. Mnesia ensures that no + is fully synchronized by the DBMS. Mnesia ensures that no two processes manipulate data simultaneously. Transactions can be assigned the property of being executed on @@ -132,29 +132,29 @@
Add-On Application -

Query List Comprehension (QLC) can be used with Mnesia +

Query List Comprehension (QLC) can be used with Mnesia to produce specialized functions that enhance the operational - ability of Mnesia. QLC has its own documentation as part + ability of Mnesia. QLC has its own documentation as part of the OTP documentation set. The main features of QLC - when used with Mnesia are as follows:

+ when used with Mnesia are as follows:

- QLC can optimize the query compiler for the Mnesia + QLC can optimize the query compiler for the Mnesia DBMS, essentially making the DBMS more efficient. QLC can be used as a database programming - language for Mnesia. It includes a notation called "list + language for Mnesia. It includes a notation called "list comprehensions" and can be used to make complex database queries over a set of tables.

For information about QLC, see the qlc manual page - in STDLIB.

+ in STDLIB.

When to Use Mnesia -

Use Mnesia with the following types of applications:

+

Use Mnesia with the following types of applications:

Applications that need to replicate data. @@ -166,7 +166,7 @@ Applications that use soft real-time characteristics. -

Mnesia is not as appropriate with the +

Mnesia is not as appropriate with the following types of applications:

Programs that process plain text or binary data files. @@ -176,14 +176,14 @@ library module dets, which is a disc-based version of the module ets. For information about dets, see the dets - manual page in STDLIB. + manual page in STDLIB. Applications that need disc logging facilities. Those applications can use the module disk_log by preference. For information about disk_log, see the disk_log - manual page in Kernel. + manual page in Kernel. Hard real-time systems. diff --git a/lib/mnesia/doc/src/mnesia.xml b/lib/mnesia/doc/src/mnesia.xml index b35214cde9..621b6047ee 100644 --- a/lib/mnesia/doc/src/mnesia.xml +++ b/lib/mnesia/doc/src/mnesia.xml @@ -37,7 +37,7 @@

The following are some of the most important and attractive - capabilities provided by Mnesia:

+ capabilities provided by Mnesia:

A relational/object hybrid data model that is suitable for telecommunications applications. @@ -62,15 +62,15 @@ reconfigured at runtime without stopping the system. -

This Reference Manual describes the Mnesia API. This - includes functions that define and manipulate Mnesia +

This Reference Manual describes the Mnesia API. This + includes functions that define and manipulate Mnesia tables.

All functions in this Reference Manual can be used in any combination with queries using the list comprehension notation. For information about the query notation, see the qlc - manual page in STDLIB.

-

Data in Mnesia is organized as a set of tables. Each table + manual page in STDLIB.

+

Data in Mnesia is organized as a set of tables. Each table has a name that must be an atom. Each table is made up of Erlang records. The user is responsible for the record definitions. Each table also has a set of properties. The @@ -121,14 +121,14 @@

index. This is a list of attribute names, or integers, which specify the tuple positions on which - Mnesia is to build and maintain an extra index + Mnesia is to build and maintain an extra index table.

local_content. When an application requires tables whose contents are local to each node, local_content tables can be used. The table name - is known to all Mnesia nodes, but its content is + is known to all Mnesia nodes, but its content is unique on each node. This means that access to such a table must be done locally. Set field local_content to true to enable the local_content @@ -143,7 +143,7 @@ avoid inconsistencies because of network splits.

-

snmp. Each (set-based) Mnesia table can be +

snmp. Each (set-based) Mnesia table can be automatically turned into a Simple Network Management Protocol (SNMP) ordered table as well. This property specifies the types of the SNMP keys.

@@ -174,7 +174,7 @@ copy of each modified record during the transaction. During iteration, that is, mnesia:fold[lr]/4, mnesia:next/2, mnesia:prev/2, and - mnesia:snmp_get_next_index/2, Mnesia + mnesia:snmp_get_next_index/2, Mnesia compensates for every written or deleted record, which can reduce the performance.

If possible, avoid writing or deleting records in the same @@ -188,7 +188,7 @@

Makes the transaction silently return the tuple {aborted, Reason}. - Termination of a Mnesia transaction means that + Termination of a Mnesia transaction means that an exception is thrown to an enclosing catch. Thus, the expression catch mnesia:abort(x) does not terminate the transaction.

@@ -324,7 +324,7 @@ mnesia:ets. Argument AccessMod is the name of a callback module, which implements the mnesia_access behavior.

-

Mnesia forwards calls to the following functions:

+

Mnesia forwards calls to the following functions:

mnesia:lock/2 (read_lock_table/1, write_lock_table/1) @@ -391,15 +391,15 @@

ActivityId is a record that represents the identity - of the enclosing Mnesia activity. The first field + of the enclosing Mnesia activity. The first field (obtained with element(1, ActivityId)) contains an atom, which can be interpreted as the activity type: ets, async_dirty, sync_dirty, or tid. tid means that the activity is a transaction. The structure of the rest of the identity - record is internal to Mnesia.

+ record is internal to Mnesia.

Opaque is an opaque data structure that is internal - to Mnesia.

+ to Mnesia.

@@ -458,7 +458,7 @@ mnesia:add_table_index(person, age)

Calls the Fun in a context that is not protected by - a transaction. The Mnesia function calls performed in + a transaction. The Mnesia function calls performed in the Fun are mapped to the corresponding dirty functions. This still involves logging, replication, and subscriptions, but there is no locking, local transaction @@ -467,7 +467,7 @@ mnesia:add_table_index(person, age) for normal mnesia:dirty_* operations, the operations are performed semi-asynchronously. For details, see mnesia:activity/4 and the User's Guide.

-

The Mnesia tables can be manipulated without +

The Mnesia tables can be manipulated without using transactions. This has some serious disadvantages, but is considerably faster, as the transaction manager is not involved and no locks are set. A dirty operation does, @@ -480,7 +480,7 @@ mnesia:add_table_index(person, age) read records dirty than within a transaction.

Depending on the application, it can be a good idea to use the dirty functions for certain operations. Almost all - Mnesia functions that can be called within + Mnesia functions that can be called within transactions have a dirty equivalent, which is much more efficient.

However, notice that there is a risk that the database can @@ -497,7 +497,7 @@ mnesia:add_table_index(person, age) Backs up all tables in the database. -

Activates a new checkpoint covering all Mnesia tables, +

Activates a new checkpoint covering all Mnesia tables, including the schema, with maximum degree of redundancy, and performs a backup using backup_checkpoint/2/3. The default value of the backup callback module BackupMod @@ -529,16 +529,16 @@ mnesia:add_table_index(person, age) extra_db_nodes -

Value is a list of nodes that Mnesia +

Value is a list of nodes that Mnesia is to try to connect to. ReturnValue is those - nodes in Value that Mnesia is connected + nodes in Value that Mnesia is connected to.

Notice that this function must only be used to connect to newly started RAM nodes (N.D.R.S.N.) with an empty schema. If, for example, this function is used after the network has been partitioned, it can lead to inconsistent tables.

-

Notice that Mnesia can be connected to other +

Notice that Mnesia can be connected to other nodes than those returned in ReturnValue.

dc_dump_limit @@ -548,7 +548,7 @@ mnesia:add_table_index(person, age) Configuration Parameters. ReturnValue is the new value. Notice that this configuration parameter is not persistent. It is lost when - Mnesia has stopped.

+ Mnesia has stopped.

@@ -562,9 +562,9 @@ mnesia:add_table_index(person, age) read_write but it can also be set to the atom read_only. If AccessMode is set to read_only, updates to the table cannot be - performed. At startup, Mnesia always loads + performed. At startup, Mnesia always loads read_only tables locally regardless of when and if - Mnesia is terminated on other nodes.

+ Mnesia is terminated on other nodes.

@@ -620,13 +620,13 @@ mnesia:change_table_copy_type(person, node(), disc_copies)

Creates a new database on disc. Various files are - created in the local Mnesia directory of each node. + created in the local Mnesia directory of each node. Notice that the directory must be unique for each node. Two nodes must never share the same directory. If possible, use a local disc device to improve performance.

mnesia:create_schema/1 fails if any of the Erlang nodes given as DiscNodes are not alive, if - Mnesia is running on any of the nodes, or if any + Mnesia is running on any of the nodes, or if any of the nodes already have a schema. Use mnesia:delete_schema/1 to get rid of old faulty schemas.

@@ -638,10 +638,10 @@ mnesia:change_table_copy_type(person, node(), disc_copies)
create_table(Name, TabDef) -> {atomic, ok} | {aborted, Reason} - Creates a Mnesia table called Namewith properties as described by argument TabDef. + Creates a Mnesia table called Namewith properties as described by argument TabDef. -

Creates a Mnesia table called +

Creates a Mnesia table called Name according to argument TabDef. This list must be a list of {Item, Value} tuples, where the following values are allowed:

@@ -652,8 +652,8 @@ mnesia:change_table_copy_type(person, node(), disc_copies) set to the atom read_only. If AccessMode is set to read_only, updates to the table cannot be performed.

-

At startup, Mnesia always loads read_only - table locally regardless of when and if Mnesia is +

At startup, Mnesia always loads read_only + table locally regardless of when and if Mnesia is terminated on other nodes. This argument returns the access mode of the table. The access mode can be read_only or read_write.

@@ -693,7 +693,7 @@ mnesia:change_table_copy_type(person, node(), disc_copies)

{index, Intlist}, where Intlist is a list of attribute names (atoms) or - record fields for which Mnesia is to build and + record fields for which Mnesia is to build and maintain an extra index table. The qlc query compiler may be able to optimize queries if there are indexes available.

@@ -735,10 +735,10 @@ mnesia:change_table_copy_type(person, node(), disc_copies) mnesia:create_table/2, the table is immediately accessible by SNMP. Therefore applications that use SNMP to manipulate and control the system can be - designed easily, since Mnesia provides a + designed easily, since Mnesia provides a direct mapping between the logical tables that make up an SNMP control application and the physical data that - makes up a Mnesia table.

+ makes up a Mnesia table.

{storage_properties, [{Backend, Properties}] @@ -746,7 +746,7 @@ mnesia:change_table_copy_type(person, node(), disc_copies) Backend can currently be ets or dets. Properties is a list of options sent to the back end storage during table creation. Properties - cannot contain properties already used by Mnesia, + cannot contain properties already used by Mnesia, such as type or named_table.

For example:

@@ -776,7 +776,7 @@ mnesia:create_table(table, [{ram_copies, [node()]}, {disc_only_copies, nodes()}, mnesia:create_table(person, [{ram_copies, [N1, N2]}, {attributes, record_info(fields, person)}]). -

If it is required that Mnesia must build and +

If it is required that Mnesia must build and maintain an extra index table on attribute address of all the person records that are inserted in the table, the following code would be issued:

@@ -819,8 +819,8 @@ mnesia:create_table(person, When the last replica is deleted with this function, the table disappears entirely.

This function can also be used to delete a replica of - the table named schema. The Mnesia node is - then removed. Notice that Mnesia must be + the table named schema. The Mnesia node is + then removed. Notice that Mnesia must be stopped on the node first.

@@ -891,9 +891,9 @@ mnesia:create_table(person, mnesia:create_schema/1. mnesia:delete_schema/1 fails if any of the Erlang nodes given as DiscNodes are not alive, or if - Mnesia is running on any of the nodes.

+ Mnesia is running on any of the nodes.

After the database is deleted, it can still be possible - to start Mnesia as a disc-less node. This depends + to start Mnesia as a disc-less node. This depends on how configuration parameter schema_location is set.

@@ -1100,7 +1100,7 @@ mnesia:create_table(person, dirty_update_counter(Tab, Key, Incr) -> NewVal | exit({aborted, Reason}) Dirty update of a counter record. -

Mnesia has no special counter records. However, +

Mnesia has no special counter records. However, records of the form {Tab, Key, Integer} can be used as (possibly disc-resident) counters when Tab is a set. This function updates a counter with a positive @@ -1147,7 +1147,7 @@ mnesia:create_table(person,

Performs a user-initiated dump of the local log file. - This is usually not necessary, as Mnesia by default + This is usually not necessary, as Mnesia by default manages this automatically. See configuration parameters dump_log_time_threshold and @@ -1172,7 +1172,7 @@ mnesia:create_table(person, Dumps local tables into a text file. -

Dumps all local tables of a Mnesia system into a +

Dumps all local tables of a Mnesia system into a text file, which can be edited (by a normal text editor) and then be reloaded with mnesia:load_textfile/1. Only use this function for @@ -1182,10 +1182,10 @@ mnesia:create_table(person, error_description(Error) -> String - Returns a string describing a particular Mnesia error. + Returns a string describing a particular Mnesia error. -

All Mnesia transactions, including all the schema +

All Mnesia transactions, including all the schema update functions, either return value {atomic, Val} or the tuple {aborted, Reason}. Reason can be either of the atoms in the following list. The @@ -1264,8 +1264,8 @@ mnesia:create_table(person,

Calls the Fun in a raw context that is not protected by - a transaction. The Mnesia function call is performed in - the Fun and performed directly on the local ets + a transaction. The Mnesia function call is performed in + the Fun and performed directly on the local ETS tables on the assumption that the local storage type is ram_copies and the tables are not replicated to other nodes. Subscriptions are not triggered and checkpoints are @@ -1321,13 +1321,13 @@ mnesia:create_table(person, Forces a table to be loaded into the system. -

The Mnesia algorithm for table load can lead to a +

The Mnesia algorithm for table load can lead to a situation where a table cannot be loaded. This situation - occurs when a node is started and Mnesia concludes, or + occurs when a node is started and Mnesia concludes, or suspects, that another copy of the table was active after this local copy became inactive because of a system crash.

If this situation is not acceptable, this function can be - used to override the strategy of the Mnesia table + used to override the strategy of the Mnesia table load algorithm. This can lead to a situation where some transaction effects are lost with an inconsistent database as result, but for some applications high availability is more @@ -1402,9 +1402,9 @@ mnesia:create_table(person,

Prints system information on the terminal. - This function can be used even if Mnesia is not + This function can be used even if Mnesia is not started. However, more information is displayed if - Mnesia is started.

+ Mnesia is started.

@@ -1431,7 +1431,7 @@ mnesia:create_table(person,

Installs a backup as fallback. The fallback is used to restore the database at the next startup. Installation of fallbacks requires Erlang to be operational on all the - involved nodes, but it does not matter if Mnesia + involved nodes, but it does not matter if Mnesia is running or not. The installation of the fallback fails if the local node is not one of the disc-resident nodes in the backup.

@@ -1465,14 +1465,14 @@ mnesia:create_table(person,

{mnesia_dir, AlternateDir}. This argument is only valid if the scope of the installation is local. Normally the installation - of a fallback is targeted to the Mnesia directory, + of a fallback is targeted to the Mnesia directory, as configured with configuration parameter -mnesia dir. But by explicitly supplying an AlternateDir, the fallback is installed there - regardless of the Mnesia directory configuration + regardless of the Mnesia directory configuration parameter setting. After installation of a fallback on - an alternative Mnesia directory, that directory - is fully prepared for use as an active Mnesia + an alternative Mnesia directory, that directory + is fully prepared for use as an active Mnesia directory.

This is a dangerous feature that must be used with care. By unintentional mixing of directories, @@ -1509,7 +1509,7 @@ mnesia:create_table(person,

Loads a series of definitions and data found in the text file (generated with mnesia:dump_to_textfile/1) - into Mnesia. This function also starts Mnesia + into Mnesia. This function also starts Mnesia and possibly creates a new schema. This function is intended for educational purposes only. It is recommended to use other functions to deal with real backups.

@@ -1558,7 +1558,7 @@ mnesia:create_table(person,

Conflicting lock requests are automatically queued if there is no risk of a deadlock. Otherwise the transaction must be - terminated and executed again. Mnesia does this + terminated and executed again. Mnesia does this automatically as long as the upper limit of the maximum retries is not reached. For details, see mnesia:transaction/3.

@@ -1726,19 +1726,19 @@ mnesia:create_table(person,
report_event(Event) -> ok - Reports a user event to the Mnesia event handler. + Reports a user event to the Mnesia event handler. -

When tracing a system of Mnesia applications it is - useful to be able to interleave Mnesia own events with +

When tracing a system of Mnesia applications it is + useful to be able to interleave Mnesia own events with application-related events that give information about the application context.

Whenever the application begins a - new and demanding Mnesia task, or if it enters a new + new and demanding Mnesia task, or if it enters a new interesting phase in its execution, it can be a good idea to use mnesia:report_event/1. Event can be any term and generates a {mnesia_user, Event} event - for any processes that subscribe to Mnesia system + for any processes that subscribe to Mnesia system events.

@@ -1748,7 +1748,7 @@ mnesia:create_table(person,

With this function, tables can be restored online from a - backup without restarting Mnesia. + backup without restarting Mnesia. Opaque is forwarded to the backup module. Args is a list of the following tuples:

@@ -1873,7 +1873,7 @@ mnesia:create_table(person,

For a complete description of select, see the ERTS User's Guide and the ets manual page in - STDLIB.

+ STDLIB.

For example, to find the names of all male persons older than 30 in table Tab:

@@ -1920,10 +1920,10 @@ mnesia:select(Tab,[{MatchHead, [Guard], [Result]}]), set_debug_level(Level) -> OldLevel - Changes the internal debug level of Mnesia. + Changes the internal debug level of Mnesia. -

Changes the internal debug level of Mnesia. +

Changes the internal debug level of Mnesia. For details, see Section Configuration Parameters.

@@ -1934,7 +1934,7 @@ mnesia:select(Tab,[{MatchHead, [Guard], [Result]}]), Sets the master nodes for all tables. -

For each table Mnesia determines its replica nodes +

For each table Mnesia determines its replica nodes (TabNodes) and starts mnesia:set_master_nodes(Tab, TabMasterNodes). where TabMasterNodes is the intersection of @@ -1952,16 +1952,16 @@ mnesia:select(Tab,[{MatchHead, [Guard], [Result]}]), that can have caused an inconsistent database, it can use the function mnesia:set_master_nodes(Tab, MasterNodes) to define from which nodes each table is to be loaded. - At startup, the Mnesia normal table load algorithm is + At startup, the Mnesia normal table load algorithm is bypassed and the table is loaded from one of the master nodes - defined for the table, regardless of when and if Mnesia + defined for the table, regardless of when and if Mnesia terminated on other nodes. MasterNodes can only contain nodes where the table has a replica. If the MasterNodes list is empty, the master node recovery mechanism for the particular table is reset, and the normal load mechanism is used at the next restart.

The master node setting is always local. It can be - changed regardless if Mnesia is started or not.

+ changed regardless if Mnesia is started or not.

The database can also become inconsistent if configuration parameter max_wait_for_decision is used or if mnesia:force_load_table/1 is used.

@@ -1976,7 +1976,7 @@ mnesia:select(Tab,[{MatchHead, [Guard], [Result]}]),
snmp_get_mnesia_key(Tab, RowIndex) -> {ok, Key} | undefined - Gets the corresponding Mnesia key from an SNMP index. + Gets the corresponding Mnesia key from an SNMP index. Tab ::= atom() RowIndex ::= [integer()] @@ -1984,7 +1984,7 @@ mnesia:select(Tab,[{MatchHead, [Guard], [Result]}]), key() ::= integer() | string() | [integer()] -

Transforms an SNMP index to the corresponding Mnesia +

Transforms an SNMP index to the corresponding Mnesia key. If the SNMP table has multiple keys, the key is a tuple of the key columns.

@@ -2020,7 +2020,7 @@ mnesia:select(Tab,[{MatchHead, [Guard], [Result]}]),
snmp_open_table(Tab, SnmpStruct) -> {aborted, R} | {atomic, ok} - Organizes a Mnesia table as an SNMP table. + Organizes a Mnesia table as an SNMP table. Tab ::= atom() SnmpStruct ::= [{key, type()}] @@ -2029,14 +2029,14 @@ mnesia:select(Tab,[{MatchHead, [Guard], [Result]}]),

A direct one-to-one mapping can be established between - Mnesia tables and SNMP tables. Many telecommunication + Mnesia tables and SNMP tables. Many telecommunication applications are controlled and monitored by the SNMP - protocol. This connection between Mnesia and SNMP + protocol. This connection between Mnesia and SNMP makes it simple and convenient to achieve this mapping.

Argument SnmpStruct is a list of SNMP information. Currently, the only information needed is information about the key types in the table. Multiple - keys cannot be handled in Mnesia, but many SNMP + keys cannot be handled in Mnesia, but many SNMP tables have multiple keys. Therefore, the following convention is used: if a table has multiple keys, these must always be stored as a tuple of the keys. Information about @@ -2069,39 +2069,39 @@ mnesia:create_table(employee,

When a table is SNMP ordered, modifications are more expensive than usual, O(logN). Also, more memory is used.

Notice that only the lexicographical SNMP ordering is - implemented in Mnesia, not the actual SNMP monitoring.

+ implemented in Mnesia, not the actual SNMP monitoring.

start() -> ok | {error, Reason} - Starts a local Mnesia system. + Starts a local Mnesia system. -

The startup procedure for a set of Mnesia nodes is a - fairly complicated operation. A Mnesia system consists - of a set of nodes, with Mnesia started locally on all +

The startup procedure for a set of Mnesia nodes is a + fairly complicated operation. A Mnesia system consists + of a set of nodes, with Mnesia started locally on all participating nodes. Normally, each node has a directory where - all the Mnesia files are written. This directory is - referred to as the Mnesia directory. Mnesia can + all the Mnesia files are written. This directory is + referred to as the Mnesia directory. Mnesia can also be started on disc-less nodes. For more information about disc-less nodes, see mnesia:create_schema/1 and the User's Guide.

-

The set of nodes that makes up a Mnesia system is kept - in a schema. Mnesia nodes can be added to or removed +

The set of nodes that makes up a Mnesia system is kept + in a schema. Mnesia nodes can be added to or removed from the schema. The initial schema is normally created on disc with the function mnesia:create_schema/1. On disc-less nodes, a tiny default schema is generated each time - Mnesia is started. During the startup procedure, - Mnesia exchanges schema information between the nodes + Mnesia is started. During the startup procedure, + Mnesia exchanges schema information between the nodes to verify that the table definitions are compatible.

Each schema has a unique cookie, which can be regarded as a unique schema identifier. The cookie must be the same on all - nodes where Mnesia is supposed to run. For details, + nodes where Mnesia is supposed to run. For details, see the User's Guide.

-

The schema file and all other files that Mnesia - needs are kept in the Mnesia directory. The +

The schema file and all other files that Mnesia + needs are kept in the Mnesia directory. The command-line option -mnesia dir Dir can be used to - specify the location of this directory to the Mnesia + specify the location of this directory to the Mnesia system. If no such command-line option is found, the name of the directory defaults to Mnesia.Node.

application:start(mnesia) can also be used.

@@ -2109,10 +2109,10 @@ mnesia:create_table(employee,
stop() -> stopped - Stops Mnesia locally. + Stops Mnesia locally. -

Stops Mnesia locally on the current node.

+

Stops Mnesia locally on the current node.

application:stop(mnesia) can also be used.

@@ -2132,7 +2132,7 @@ mnesia:create_table(employee,

Calls the Fun in a context that is not protected by - a transaction. The Mnesia function calls performed in + a transaction. The Mnesia function calls performed in the Fun are mapped to the corresponding dirty functions. It is performed in almost the same context as mnesia:async_dirty/1,2. The difference is that the @@ -2167,10 +2167,10 @@ mnesia:create_table(employee, system_info(InfoKey) -> Info | exit({aborted, Reason}) - Returns information about the Mnesia system. + Returns information about the Mnesia system. -

Returns information about the Mnesia system, such as +

Returns information about the Mnesia system, such as transaction statistics, db_nodes, and configuration parameters. The valid keys are as follows:

@@ -2188,7 +2188,7 @@ mnesia:create_table(employee,

auto_repair. Returns true or false - to indicate if Mnesia is configured to start the + to indicate if Mnesia is configured to start the auto-repair facility on corrupted disc files.

@@ -2209,20 +2209,20 @@ mnesia:create_table(employee, in the list of nodes if they explicitly have been added to the schema, for example, with mnesia:add_table_copy/3. The function can be - started even if Mnesia is not yet running.

+ started even if Mnesia is not yet running.

debug. Returns the current debug level of - Mnesia.

+ Mnesia.

-

directory. Returns the name of the Mnesia - directory. It can be called even if Mnesia is +

directory. Returns the name of the Mnesia + directory. It can be called even if Mnesia is not yet running.

dump_log_load_regulation. Returns a boolean that - tells if Mnesia is configured to regulate the + tells if Mnesia is configured to regulate the dumper process load.

This feature is temporary and will be removed in future releases.

@@ -2233,9 +2233,9 @@ mnesia:create_table(employee,

dump_log_update_in_place. Returns a boolean that - tells if Mnesia is configured to perform the - updates in the dets files directly, or if the - updates are to be performed in a copy of the dets + tells if Mnesia is configured to perform the + updates in the Dets files directly, or if the + updates are to be performed in a copy of the Dets files.

@@ -2253,13 +2253,13 @@ mnesia:create_table(employee,

held_locks. Returns a list of all - locks held by the local Mnesia lock manager.

+ locks held by the local Mnesia lock manager.

is_running. Returns yes or no to - indicate if Mnesia is running. It can + indicate if Mnesia is running. It can also return starting or stopping. Can be - called even if Mnesia is not yet running.

+ called even if Mnesia is not yet running.

local_tables. Returns a list @@ -2272,7 +2272,7 @@ mnesia:create_table(employee,

log_version. Returns the version - number of the Mnesia transaction log format.

+ number of the Mnesia transaction log format.

master_node_tables. Returns a @@ -2280,25 +2280,25 @@ mnesia:create_table(employee,

protocol_version. Returns the version number of - the Mnesia inter-process communication protocol.

+ the Mnesia inter-process communication protocol.

running_db_nodes. Returns a list of nodes where - Mnesia currently is running. This function can be - called even if Mnesia is not yet running, but it + Mnesia currently is running. This function can be + called even if Mnesia is not yet running, but it then has slightly different semantics.

-

If Mnesia is down on the local node, the function +

If Mnesia is down on the local node, the function returns those other db_nodes and extra_db_nodes that for the moment are operational.

-

If Mnesia is started, the function returns - those nodes that Mnesia on the local node is fully - connected to. Only those nodes that Mnesia has +

If Mnesia is started, the function returns + those nodes that Mnesia on the local node is fully + connected to. Only those nodes that Mnesia has exchanged schema information with are included as running_db_nodes. After the merge of schemas, the - local Mnesia system is fully operable and + local Mnesia system is fully operable and applications can perform access of remote replicas. - Before the schema merge, Mnesia only operates + Before the schema merge, Mnesia only operates locally. Sometimes there are more nodes included in the running_db_nodes list than all db_nodes and extra_db_nodes together.

@@ -2322,17 +2322,17 @@ mnesia:create_table(employee,

transaction_failures. Returns a number that indicates how many transactions have - failed since Mnesia was started.

+ failed since Mnesia was started.

transaction_commits. Returns a number that indicates how many transactions have - terminated successfully since Mnesia was started.

+ terminated successfully since Mnesia was started.

transaction_restarts. Returns a number that indicates how many transactions have been - restarted since Mnesia was started.

+ restarted since Mnesia was started.

transaction_log_writes. @@ -2342,12 +2342,12 @@ mnesia:create_table(employee,

use_dir. Returns a boolean that indicates if - the Mnesia directory is used or not. Can be - started even if Mnesia is not yet running.

+ the Mnesia directory is used or not. Can be + started even if Mnesia is not yet running.

version. Returns the current - version number of Mnesia.

+ version number of Mnesia.

@@ -2359,13 +2359,13 @@ mnesia:create_table(employee,

Returns a Query List Comprehension (QLC) query handle, see the qlc(3) - manual page in STDLIB. The module qlc - implements a query language that can use Mnesia + manual page in STDLIB. The module qlc + implements a query language that can use Mnesia tables as sources of data. Calling mnesia:table/1,2 is the means to make the mnesia table Tab usable to QLC.

-

Option can contain Mnesia - options or QLC options. Mnesia recognizes the +

Option can contain Mnesia + options or QLC options. Mnesia recognizes the following options (any other option is forwarded to QLC).

@@ -2374,7 +2374,7 @@ mnesia:create_table(employee, {n_objects,Number}, where n_objects specifies (roughly) the number of objects returned - from Mnesia to QLC. Queries to remote tables + from Mnesia to QLC. Queries to remote tables can need a larger chunk to reduce network overhead. By default, 100 objects at a time are returned. @@ -2413,7 +2413,7 @@ mnesia:create_table(employee,

The table_info/2 function takes two arguments. - The first is the name of a Mnesia table. + The first is the name of a Mnesia table. The second is one of the following keys:

@@ -2465,7 +2465,7 @@ mnesia:create_table(employee,

load_node. Returns the name of - the node that Mnesia loaded the table from. The + the node that Mnesia loaded the table from. The structure of the returned value is unspecified, but can be useful for debugging purposes.

@@ -2476,7 +2476,7 @@ mnesia:create_table(employee,

load_reason. Returns the - reason of why Mnesia decided to load the table. + reason of why Mnesia decided to load the table. The structure of the returned value is unspecified, but can be useful for debugging purposes.

@@ -2620,7 +2620,7 @@ raise(Name, Amount) -> several processes running on different nodes can concurrently execute the function raise/2 without interfering with each other.

-

Since Mnesia detects deadlocks, a transaction can be +

Since Mnesia detects deadlocks, a transaction can be restarted any number of times. This function attempts a restart as specified in Retries. Retries must be an integer greater than 0 or the atom infinity. @@ -2643,7 +2643,7 @@ raise(Name, Amount) ->

NewAttributeList and NewRecordName specify the attributes and the new record type of the converted table. Table name always remains unchanged. If - record_name is changed, only the Mnesia + record_name is changed, only the Mnesia functions that use table identifiers work, for example, mnesia:write/3 works, but not mnesia:write/1.

@@ -2706,7 +2706,7 @@ raise(Name, Amount) -> distributed operation that is either performed on all nodes with disc resident schema, or none. Uninstallation of fallbacks requires Erlang to be operational on all - involved nodes, but it does not matter if Mnesia is + involved nodes, but it does not matter if Mnesia is running or not. Which nodes that are considered as disc-resident nodes is determined from the schema information in the local fallback.

@@ -2792,28 +2792,28 @@ raise(Name, Amount) ->
Configuration Parameters -

Mnesia reads the following application configuration +

Mnesia reads the following application configuration parameters:

-mnesia access_module Module. The name of the - Mnesia activity access callback module. Default is + Mnesia activity access callback module. Default is mnesia.

-mnesia auto_repair true | false. This flag - controls if Mnesia automatically tries to repair + controls if Mnesia automatically tries to repair files that have not been properly closed. Default is true.

-mnesia backup_module Module. The name of the - Mnesia backup callback module. Default is + Mnesia backup callback module. Default is mnesia_backup.

-mnesia debug Level. Controls the debug level - of Mnesia. The possible values are as follows:

+ of Mnesia. The possible values are as follows:

none @@ -2825,7 +2825,7 @@ raise(Name, Amount) -> events generate {mnesia_info, Format, Args} system events. Processes can subscribe to these events with mnesia:subscribe/1. The events are always sent to - the Mnesia event handler.

+ the Mnesia event handler.

debug @@ -2834,15 +2834,15 @@ raise(Name, Amount) -> {mnesia_info, Format, Args} system events. Processes can subscribe to these events with mnesia:subscribe/1. The events are always sent to - the Mnesia event handler. On this debug level, - the Mnesia event handler starts subscribing to + the Mnesia event handler. On this debug level, + the Mnesia event handler starts subscribing to updates in the schema table.

trace

Activates all events at the debug level. On this - level, the Mnesia event handler starts subscribing - to updates on all Mnesia tables. This level is + level, the Mnesia event handler starts subscribing + to updates on all Mnesia tables. This level is intended only for debugging small toy systems, as many large events can be generated.

@@ -2856,7 +2856,7 @@ raise(Name, Amount) ->

-mnesia core_dir Directory. The name of the - directory where Mnesia core files is stored, or + directory where Mnesia core files is stored, or false. Setting it implies that also RAM-only nodes generate a core file if a crash occurs.

@@ -2870,9 +2870,9 @@ raise(Name, Amount) ->

-mnesia dir Directory. The name of the directory - where all Mnesia data is stored. The directory name + where all Mnesia data is stored. The directory name must be unique for the current node. Two nodes must never - share the the same Mnesia directory. The results + share the the same Mnesia directory. The results are unpredictable.

@@ -2915,44 +2915,44 @@ raise(Name, Amount) ->

-mnesia event_module Module. The name of the - Mnesia event handler callback module. Default is + Mnesia event handler callback module. Default is mnesia_event.

-mnesia extra_db_nodes Nodes specifies a list of nodes, in addition to the ones found in the schema, with - which Mnesia is also to establish contact. Default + which Mnesia is also to establish contact. Default is [] (empty list).

-mnesia fallback_error_function {UserModule, UserFunc}. Specifies a user-supplied callback function, which is - called if a fallback is installed and Mnesia goes - down on another node. Mnesia calls the function + called if a fallback is installed and Mnesia goes + down on another node. Mnesia calls the function with one argument, the name of the dying node, for example, - UserModule:UserFunc(DyingNode). Mnesia must + UserModule:UserFunc(DyingNode). Mnesia must be restarted, otherwise the database can be inconsistent. - The default behavior is to terminate Mnesia.

+ The default behavior is to terminate Mnesia.

-mnesia max_wait_for_decision Timeout. Specifies - how long Mnesia waits for other nodes to share their + how long Mnesia waits for other nodes to share their knowledge about the outcome of an unclear transaction. By default, Timeout is set to the atom infinity. - This implies that if Mnesia upon startup detects + This implies that if Mnesia upon startup detects a "heavyweight transaction" whose outcome is unclear, the - local Mnesia waits until Mnesia is started + local Mnesia waits until Mnesia is started on some (in the worst case all) of the other nodes that were involved in the interrupted transaction. This is a rare - situation, but if it occurs, Mnesia does not guess if + situation, but if it occurs, Mnesia does not guess if the transaction on the other nodes was committed or - terminated. Mnesia waits until it knows the outcome + terminated. Mnesia waits until it knows the outcome and then acts accordingly.

If Timeout is set to an integer value in - milliseconds, Mnesia forces "heavyweight transactions" + milliseconds, Mnesia forces "heavyweight transactions" to be finished, even if the outcome of the transaction for the moment is unclear. After Timeout milliseconds, - Mnesia commits or terminates the transaction and + Mnesia commits or terminates the transaction and continues with the startup. This can lead to a situation where the transaction is committed on some nodes and terminated on other nodes. If the transaction is a @@ -2976,14 +2976,14 @@ raise(Name, Amount) ->

-mnesia schema_location Loc. Controls where - Mnesia looks for its schema. Parameter + Mnesia looks for its schema. Parameter Loc can be one of the following atoms:

disc

Mandatory disc. The schema is assumed to be located - in the Mnesia directory. If the schema cannot - be found, Mnesia refuses to start. This is the + in the Mnesia directory. If the schema cannot + be found, Mnesia refuses to start. This is the old behavior.

ram @@ -3001,10 +3001,10 @@ raise(Name, Amount) -> opt_disc

Optional disc. The schema can reside on disc or in - RAM. If the schema is found on disc, Mnesia + RAM. If the schema is found on disc, Mnesia starts as a disc-based node and the storage type of the schema table is disc_copies. If no schema is - found on disc, Mnesia starts as a disc-less node + found on disc, Mnesia starts as a disc-less node and the storage type of the schema table is ram_copies. Default value for the application parameter is opt_disc.

@@ -3012,7 +3012,7 @@ raise(Name, Amount) ->
-

First, the SASL application parameters are checked, +

First, the SASL application parameters are checked, then the command-line flags are checked, and finally, the default value is chosen.

diff --git a/lib/mnesia/doc/src/mnesia_frag_hash.xml b/lib/mnesia/doc/src/mnesia_frag_hash.xml index 95f5f8aa07..51b32129b6 100644 --- a/lib/mnesia/doc/src/mnesia_frag_hash.xml +++ b/lib/mnesia/doc/src/mnesia_frag_hash.xml @@ -87,13 +87,13 @@ the new one.

NewState is stored as hash_state among the other frag_properties.

-

As a part of the add_frag procedure, Mnesia iterates +

As a part of the add_frag procedure, Mnesia iterates over all fragments corresponding to the IterFrags numbers and starts key_to_frag_number(NewState,RecordKey) for each record. If the new fragment differs from the old fragment, the record is moved to the new fragment.

As the add_frag procedure is a part of a schema - transaction, Mnesia acquires write locks on the + transaction, Mnesia acquires write locks on the affected tables. That is, both the fragments corresponding to IterFrags and those corresponding to AdditionalLockFrags.

@@ -112,7 +112,7 @@

NewState is stored as hash_state among the other frag_properties.

-

As a part of the del_frag procedure, Mnesia iterates +

As a part of the del_frag procedure, Mnesia iterates over all fragments corresponding to the IterFrags numbers and starts key_to_frag_number(NewState,RecordKey) for each record. If the new fragment differs from the old @@ -120,7 +120,7 @@

Notice that all records in the last fragment must be moved to another fragment, as the entire fragment is deleted.

As the del_frag procedure is a part of a schema - transaction, Mnesia acquires write locks on the + transaction, Mnesia acquires write locks on the affected tables. That is, both the fragments corresponding to IterFrags and those corresponding to AdditionalLockFrags.

@@ -134,7 +134,7 @@ Reason = term() -

Starts whenever Mnesia needs to determine +

Starts whenever Mnesia needs to determine which fragment a certain record belongs to. It is typically started at read, write, and delete.

@@ -149,7 +149,7 @@ Reason = term() -

This function is called whenever Mnesia needs to determine +

This function is called whenever Mnesia needs to determine which fragments that need to be searched for a MatchSpec. It is typically called by select and match_object.

diff --git a/lib/mnesia/doc/src/mnesia_registry.xml b/lib/mnesia/doc/src/mnesia_registry.xml index cd778ae072..a76f716981 100644 --- a/lib/mnesia/doc/src/mnesia_registry.xml +++ b/lib/mnesia/doc/src/mnesia_registry.xml @@ -38,20 +38,20 @@ Dump support for registries in erl_interface.

This module is usually part of the erl_interface - application, but is currently part of the Mnesia + application, but is currently part of the Mnesia application.

This module is mainly intended for internal use within OTP, but it has two functions that are exported for public use.

On C-nodes, erl_interface has support for registry tables. These tables reside in RAM on the C-node, but can also - be dumped into Mnesia tables. By default, the dumping + be dumped into Mnesia tables. By default, the dumping of registry tables through erl_interface causes a - corresponding Mnesia table to be created with + corresponding Mnesia table to be created with mnesia_registry:create_table/1, if necessary.

Tables that are created with these functions can be - administered as all other Mnesia tables. They can be + administered as all other Mnesia tables. They can be included in backups, replicas can be added, and so on. - The tables are normal Mnesia tables owned by the user + The tables are normal Mnesia tables owned by the user of the corresponding erl_interface registries.

@@ -68,7 +68,7 @@ that is, {ram_copies,[node()]} or {disc_copies,[node()]}.

This function is used by erl_interface to - create the Mnesia table if it does not already + create the Mnesia table if it does not already exist.

diff --git a/lib/mnesia/doc/src/part.xml b/lib/mnesia/doc/src/part.xml index 101bdb29d4..d3ffe93937 100644 --- a/lib/mnesia/doc/src/part.xml +++ b/lib/mnesia/doc/src/part.xml @@ -30,7 +30,7 @@ part.sgml -

The Mnesia application is a distributed Database Management +

The Mnesia application is a distributed Database Management System (DBMS), appropriate for telecommunications applications and other Erlang applications, which require continuous operation and exhibit soft real-time properties.

diff --git a/lib/mnesia/doc/src/ref_man.xml b/lib/mnesia/doc/src/ref_man.xml index 662f0d61d6..7fb71b9c45 100644 --- a/lib/mnesia/doc/src/ref_man.xml +++ b/lib/mnesia/doc/src/ref_man.xml @@ -33,7 +33,7 @@ refman.sgml -

The Mnesia application is a distributed Database Management +

The Mnesia application is a distributed Database Management System (DBMS), appropriate for telecommunications applications and other Erlang applications, which require continuous operation and exhibit soft real-time properties.

-- cgit v1.2.3