Age | Commit message (Collapse) | Author |
|
* richcarl/dcd-dumps:
Make Mnesia DCD dump behaviour available via API
Make Mnesia DCD dump behaviour available via configuration
OTP-12481
|
|
During Mnesia startup, after protocol negotiation, the list of connected
nodes is written to "recover_nodes". This list is later used to merge
the schema.
If Mnesia was stopped on a remote node between the protocol negotiation
and the moment the list is stored in "recover_nodes", the remote node
is still considered running: the value of "recover_nodes" stored during
mnesia_down/1 is overwritten. Therefore, this node may be used to
acquire a write lock on the schema in order to perform the merge. In
this case, the remote node never answers to the lock request and Mnesia
hang forever (application:start(mnesia) never returns).
To fix the problem, we check the list one last time and remove from it
all nodes where Mnesia is stopped. And because there is still a chance
for missing mnesia_down event, handle_cast({mnesia_down, ...}, ...)
writes to recover_nodes again, in addition to mnesia_down/1.
|
|
If a DCD dump is desired on-demand, use the function
mnesia_controller:snapshot_dcd(Tables). Tables must be a list of
tables that have a local disc_copy, otherwise an error will be
returned. Once the operation actually executes, any table that doesn't
have a local disc_copy is ignored.
Specifically, the dump_log worker record has been changed to allow an
arity-0 fun instead of the default log dump. This fun will be executed
as if it were a normal log dump, and must return 'dumped'. This could
also be used to e.g. insert a backup operation between log dumps.
|
|
Setting the new Mnesia parameter 'dump_disc_copies_at_startup' to
'false' will completely disable the DCD dumping while tables are being
loaded. If it is set to 'true' (the default), the same test will now
be performed as for normal dumps, i.e., using the 'dc_dump_limit'
parameter. Previously, the test performed at load time was different
from the one used at runtime, and caused a lot of unnecessary dumping
which slowed down the startup.
|
|
match_object returned wrong objects when matching on non key fields
and updates in the same transaction had been performed.
|
|
Conflicts:
OTP_VERSION
|
|
By doing an abort, the create_table can be restarted
if a node go down during the transaction.
{badarg,
[{erlang,link,[undefined],[]},
{mnesia_controller,
wait_for_schema_commit_lock,0,
[{file,"mnesia_controller.erl"},
{line,303}]},
{mnesia_schema,prepare_commit,3,
[{file,"mnesia_schema.erl"},
{line,1838}]},
{mnesia_tm,commit_participant,6,
[{file,"mnesia_tm.erl"},
{line,1669}]}]}}},
|
|
|
|
* nox/reedr-logging/OTP-12115:
Add number of entries to mnesia copy debug message
Add thread index to allocator enomem dump slogan
Add run queue index to process dump info
Add missing error string to syslog logging in epmd
Demote rare debug slogan of message discarding to debug build
|
|
|
|
* gorillainduction/improve_mnesia_locker_complexity:
Optimize tid lock table
OTP-11981
|
|
By making the ets table mnesia_tid_locks an ordered set instead of a
bag, the time for inserting locks for a transaction with large number
of locks is reduced significantly.
|
|
* dgud/mnesia/timing-issue:
mnesia: Fix timing issue
|
|
* dgud/mnesia/force-load-hangs/OTP-11948:
mnesia: Handle failed net_loads better
|
|
In case of a failed net load and no more available copies,
remove the table from late_load_queue, otherwise tables
can not be forced loaded.
|
|
Be sure to gather release_tid msgs even though we have a mnesia_down
in the queue.
|
|
|
|
Most dependencies introduced are exactly the dependencies to other
applications found by xref. That is, there might be real dependencies
missing. There might also be pure debug dependencies listed that
probably should be removed. Each application has to be manually
inspected in order to ensure that all real dependencies are listed.
All dependencies introduced are to application versions used in
OTP 17.0. This since the previously used version scheme wasn't
designed for this, and in order to minimize the work of introducing
the dependencies.
|
|
|
|
Add stacktrace of mnesia processes.
|
|
For performance reasons the file data is not synced to disk in mnesia,
data loss can happen between each dump.
mnesia:dump_log() can be used explicitly to ensure data is written to disk.
But that can take a long time, so mnesia:sync_log() which just
sync the log have been added.
|
|
|
|
dirty_update_counter returned the wrong value when a subscriber existed
and no events was sent. Thanks Anton Ryabkov.
|
|
Conflicts:
erts/etc/win32/Install.c
|
|
Mnesia_monitor detect mnesia down using a remote process link
and net_kernel nodeup to detect that a node are reacable again.
If there is a short node communication problem.
The node-down and node-up events can happen before the
remotely linked process generates an 'EXIT'.
When node-down and node-up events are recevied they are
stored and later checked if the node came up just before
mnesia flagged the node as down.
|
|
Bad timing could lead to hanging transactions after a mnesia down from a
node with sticky locks.
Excellent bug report from janchochol
Situation:
* node A and B have copies of table T
* node A ows sticky of table T
* node A goes down (e.g. crash)
* node B tries to perform transactional operation on table T
(e.g. mnesia:select)
In this situation there is possibility that first (and maybe other)
transaction on node B will hang indefinitely.
This is caused by race condition, when transaction process send lock
request operation to node A and waits for reply. When node A is down
it will never send reply, so process on node B will be stuck
forever.
Reason is that message sent to mnesia_locker gen_server from
mnesia_locker:mnesia_down can be received after mnesia_locker gen_server
already replies to transaction processes with {switch, N, Req} and
node N is down.
Monitoring remote process when sending request to other node should
be safe solution.
|
|
Avoid hanging waiting for other processes on other node
to commit.
|
|
Fixed a race where some parts of a transaction could
be added to the checkpoint.
There are probably more races here but this improves the current
testcases.
|
|
We don't support communicating with such old nodes anyway.
|
|
|
|
|
|
|
|
* nm/mnesia_idx_insert_speedup/OTP-11103:
Fix missing case clause for ordered_set tables
Optimize index creation for Mnesia set tables
|
|
The previous commit contained a regression that would trigger a crash
when attempting to add an index to an Mnesia table of type ordered_set.
|
|
ETS bag tables have very poor performance on insertion if you have lots
of rows with duplicate keys, since it has to check each existing record
and make sure it's not inserting any duplicates. This can lead to some
pretty drastic slowdowns when inserting lots of rows into an Mnesia
table, IF you're introducing lots of duplicate values into an indexed
column.
As it turns out, we can fix this by switching to duplicate_bag tables
for storing Mnesia indexes on tables of type 'set', and it ultimately
makes no functional difference since we will never actually attempt to
insert any duplicate records anyway. (We would have to make some bigger
changes to make this work for Mnesia bag tables though, so that is left
as a possible enhancement for the future.)
|
|
If mnesia:cleartable/1 was called during a table_load an schema event
with delete and write of that table is sent, which caused the table
to contain the schema record instead of clearing the table.
|
|
|
|
|
|
* lh/forget-mnemosyne/OTP-10729:
Remove what remains of the Mnemosyne code
Remove support for the query keyword and query expressions
|
|
* nox/enable-silent-rules/OTP-10726:
Implement ./otp_build configure --enable-silent-rules
|
|
|
|
With silent rules, the output of make is less verbose and compilation
warnings are easier to spot. Silent rules are disabled by default and
can be disabled or enabled at will by make V=0 and make V=1.
|
|
|
|
* ao/fix_mnesia_overload_msg_format:
Fix format of mnesia overload message
OTP-10639
|
|
Using ~p in mnesia overload message could lead to wrong messages.
mnesia_tm overload message contains a list of two numbers (queue length)
example:
instead of:
Mnesia is overloaded: {mnesia_tm,message_queue_len,[100,105]}
it prints :
Mnesia is overloaded: {mnesia_tm,message_queue_len,"di"}
Replacing ~p with ~w fixes the problem as it doesn't try
to detect lists of printable characters
|
|
timer:send_interval behaves badly when resuming from sleep on some
platforms. For example, if I sleep for 10 minutes, and have a
send_interval running once per minute, when I resume, 10 messages
will be sent immediately, eliminating the benefit of only running
the work periodically. This is admittedly a separate bug with
send_interval, but the workaround is straightforward, and also
protects from messages piling up in the queue when the work takes
longer than the interval.
This patch fixes piled up error reports on resume from sleep:
** WARNING ** Mnesia is overloaded: {dump_log, write_threshold}
You'll still be warned if mnesia is overloaded, just not repeatedly.
Additionally, erlang:send_after is more efficient than using the
timer module equivalent [1]
[1] http://www.erlang.org/doc/efficiency_guide/commoncaveats.html#id57251
|
|
|
|
|
|
We have to ensure that we actually delete the last object with a
given (key, index) pair before removing the index.
|
|
OTP-10106
OTP-10107
|