aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/src
AgeCommit message (Collapse)Author
2016-10-24Merge branch 'dgud/mnesia/fix-blocked/OTP-13970' into maintDan Gudmundsson
* dgud/mnesia/fix-blocked/OTP-13970: Avoid some error reports when stopping mnesia mnesia: Fix double blocked tables which could cause a crash
2016-10-17Avoid some error reports when stopping mnesiaDan Gudmundsson
Worker processes can cause error reports if the main mnesia processes dissapear.
2016-10-11mnesia: Fix double blocked tables which could cause a crashDan Gudmundsson
Fast restarts could cause table to be blocked twice.
2016-10-06Allow reusing mnesia select continuationsDániel Szoboszlay
A continuation returned by mnesia:select/[14] should be reusable in different, non-transactional activities. Aborting with wrong_transaction doesn't make sense in a dirty context.
2016-05-24mnesia: Fix index match return patternsDan Gudmundsson
When building match result patterns the tuples they must qouted with { }, which causes a problem with variable patterns. Use element(1, Match) instead of trying to build the two tuple.
2016-05-09Merge branch 'dgud/mnesia/ext-backend/PR-858/OTP-13058'Dan Gudmundsson
* dgud/mnesia/ext-backend/PR-858/OTP-13058: mnesia_ext: Add basic backend extension tests mnesia_ext: reuse snmp field for ext updates mnesia_ext: Create table/data containers from mnesia monitor not temporary processes mnesia_ext: Implement ext copies index mnesia_ext: Load table ext mnesia_ext: Dumper and schema changes mnesia_ext: Refactor mnesia_schema.erl mnesia_ext: Ext support in fragmented tables mnesia_ext: Backup handling mnesia_ext: Create schema functionality mnesia_ext: Add ext copies and db_fold to low level api mnesia_ext: Refactor record_validation code mnesia_ext: Add create_external and increase protocol version to monitor mnesia_ext: Add ext copies to records mnesia_ext: Add supervisor and behaviour modules
2016-05-09mnesia_ext: reuse snmp field for ext updatesDan Gudmundsson
Minimal impact when talking to older nodes.
2016-05-09mnesia_ext: Create table/data containers from mnesia monitor not temporary ↵Dan Gudmundsson
processes Tables or data containers should be owned and monitored by mnesia_monitor and should thus be created by that process. Always create_table before loading it We need to create tables for ram_copies at least before loading them as they are intermittent. It is also needed to get mnesia monitor as the parent and supervisor of the data storage.
2016-05-09mnesia_ext: Implement ext copies indexUlf Wiger
Make ram_copies index always use ordered_set And use index type as prefered type not a implementation requirement, the standard implmentation will currently ignore the prefered type.
2016-05-09mnesia_ext: Load table extUlf Wiger
2016-05-09mnesia_ext: Dumper and schema changesUlf Wiger
2016-05-09mnesia_ext: Refactor mnesia_schema.erlUlf Wiger
2016-05-09mnesia_ext: Ext support in fragmented tablesUlf Wiger
2016-05-09mnesia_ext: Backup handlingUlf Wiger
2016-05-09mnesia_ext: Create schema functionalityUlf Wiger
Add ext to table/system information Add add_backend_type
2016-05-09mnesia_ext: Add ext copies and db_fold to low level apiUlf Wiger
2016-05-09mnesia_ext: Refactor record_validation codeUlf Wiger
Should maybe be moved to mnesia.erl and inlined?? Or is it used elsewhere?
2016-05-09mnesia_ext: Add create_external and increase protocol version to monitorUlf Wiger
new protocol version to handle new schema fields
2016-05-09mnesia_ext: Add ext copies to recordsUlf Wiger
2016-05-09mnesia_ext: Add supervisor and behaviour modulesUlf Wiger
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-04-04Merge tag 'OTP-18.3.1'Henrik Nord
=== OTP-18.3.1 === Changed Applications: - erts-7.3.1 - inets-6.2.1 - mnesia-4.13.4 Unchanged Applications: - asn1-4.0.2 - common_test-1.12 - compiler-6.0.3 - cosEvent-2.2 - cosEventDomain-1.2 - cosFileTransfer-1.2 - cosNotification-1.2.1 - cosProperty-1.2 - cosTime-1.2.1 - cosTransactions-1.3.1 - crypto-3.6.3 - debugger-4.1.2 - dialyzer-2.9 - diameter-1.11.2 - edoc-0.7.18 - eldap-1.2.1 - erl_docgen-0.4.2 - erl_interface-3.8.2 - et-1.5.1 - eunit-2.2.13 - gs-1.6 - hipe-3.15 - ic-4.4 - jinterface-1.6.1 - kernel-4.2 - megaco-3.18 - observer-2.1.2 - odbc-2.11.1 - orber-3.8.1 - os_mon-2.4 - ose-1.1 - otp_mibs-1.1 - parsetools-2.1.1 - percept-0.8.11 - public_key-1.1.1 - reltool-0.7 - runtime_tools-1.9.3 - sasl-2.7 - snmp-5.2.2 - ssh-4.2.2 - ssl-7.3 - stdlib-2.8 - syntax_tools-1.7 - test_server-3.10 - tools-2.8.3 - typer-0.9.10 - webtool-0.9.1 - wx-1.6.1 - xmerl-1.3.10 Conflicts: OTP_VERSION erts/emulator/test/save_calls_SUITE.erl erts/vsn.mk
2016-03-17mnesia: Send mnesia_down messages to waiting transactionsDan Gudmundsson
Mnesia didn't forward mnesia_down to transactions which where already decided to be aborted, but that could lead to hanging transactions still waiting for messages from the node which had stopped.
2016-03-15update copyright-yearHenrik Nord
2016-02-22Merge branch 'maint'Hans Bolinder
* maint: Fix a few dialyzer warnings
2016-02-22Fix a few dialyzer warningsHans Bolinder
2016-02-17Merge branch 'maint'Hans Bolinder
* maint: xmerl: Remove 'no_return' Dialyzer warnings xmerl: Add suppression of Dialyzer warnings eunit: Add suppression of Dialyzer warnings debugger: Add suppression of Dialyzer warnings kernel: Add suppression of Dialyzer warnings mnesia: Add suppression of Dialyzer warnings observer: Add suppression of Dialyzer warnings runtime_tools: Add suppression of Dialyzer warnings stdlib: Add suppression of Dialyzer warnings test_server: Add suppression of Dialyzer warnings tools: Add suppression of Dialyzer warnings Conflicts: lib/stdlib/src/erl_lint.erl lib/stdlib/src/otp_internal.erl
2016-02-17mnesia: Add suppression of Dialyzer warningsHans Bolinder
2016-02-12Merge branch 'maint'Dan Gudmundsson
* maint: mnesia: let loader check if tablelock is needed mnesia: Avoid deadlock possibility in mnesia:del_table_copy schema
2016-02-09mnesia: let loader check if tablelock is neededDan Gudmundsson
move_table_copy needs the lock that was set previously in del_table_copy. This doesn't work on old nodes, so bump protocol version and check it. Remove old protocol conversion code, which have been around since OTP-R15. Checking if lock is needed requires rpc communication via mnesia_gvar ets table to be backwards compatible.
2016-02-05mnesia: Avoid deadlock possibility in mnesia:del_table_copy schemaDan Gudmundsson
del_table_copy grabs a write lock in a new process in prepare_op/3 to change 'where_to_read' when a table copy is updated. When del_table_copy(schema, Node) is called all copies located on Node are deleted, and thus many locks are taken. Since this was done outside of the schema-transaction, mnesia's deadlock prevention algorithms was sidestepped and a deadlock could occur. Fix by always grabbing write-locks for all changed tabs early and in the same transaction, this might slow done the operation some but it must be done and it also cleans up the code.
2015-12-11Use 'rand' instead of the obsolete 'random' moduleBjörn Gustavsson
In most cases, we don't have to seed the random number generator, as the rand:uniform/1 takes care about that itself.
2015-10-02mnesia: Fix mnesia:restore/2 which caused a disk_log leakDan Gudmundsson
Introduced a leak of disk_log processes in the rewrite to try-catch.
2015-09-10mnesia: Improve index updatesDan Gudmundsson
There is no need to update the index table if a record is updated in non indexed field. This removes one timing glitch where dirty_index_read would return an empty list for records that where updated. There is still an issue with dirty_index_read when updates are made to the index field, it have been reduced but the real table updates are made after the index table references have been added. Originally reported by Nick Marino in erl-questions mailing list, thanks.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-16Revert "Add number of entries to mnesia copy debug message"Björn-Egil Dahlberg
This reverts commit baad9722c84ecb41d2278ac9912d30e42c3b4409.
2015-06-08Merge branch 'mikpe/mnesia-openlog-emfile'Henrik Nord
* mikpe/mnesia-openlog-emfile: mnesia: don't delete log file on emfile error OTP-12807
2015-05-31mnesia: don't delete log file on emfile errorMikael Pettersson
If the VM runs into the process' file descriptor limit when mnesia tries to open (not create) a disk_log file, the open fails with an emfile error. Mnesia misinterprets this as a corrupt file, deletes it, tries to create a new empty disk_log file, which also fails. The end result is a corrupt database on disk. Check for emfile errors and error out immediately without deleting the file in those cases.
2015-05-06mnesia: dirty error messages did not behave as documentedDan Gudmundsson
The docs express that exit({aborted, Reason}) are called when an error occur.
2015-03-27Merge branch 'dgud/mnesia/try-catch'Dan Gudmundsson
* dgud/mnesia/try-catch: mnesia: Replace catch with try-catch
2015-03-27mnesia: Replace catch with try-catchDan Gudmundsson
Avoids building stacktraces where it is not needed and do not mask errors, i.e. only catch the relevant classes in each try.
2015-03-20Merge branch 'rickard/time_api/OTP-11997'Rickard Green
* rickard/time_api/OTP-11997: (22 commits) Update primary bootstrap inets: Suppress deprecated warning on erlang:now/0 inets: Cleanup of multiple copies of functions Add inets_lib with common functions used by multiple modules inets: Update comments Suppress deprecated warning on erlang:now/0 Use new time API and be back-compatible in inets Remove unused functions and removed redundant test asn1 test SUITE: Eliminate use of now/0 Disable deprecated warning on erlang:now/0 in diameter_lib Use new time API and be back-compatible in ssh Replace all calls to now/0 in CT with new time API functions test_server: Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API Replace usage of erlang:now() with usage of new API otp_SUITE: Warn for calls to erlang:now/0 Replace usage of erlang:now() with usage of new API Multiple timer wheels Erlang based BIF timer implementation for scalability Implement ethread events with timeout ... Conflicts: bootstrap/bin/start.boot bootstrap/bin/start_clean.boot bootstrap/lib/compiler/ebin/beam_asm.beam bootstrap/lib/compiler/ebin/compile.beam bootstrap/lib/kernel/ebin/auth.beam bootstrap/lib/kernel/ebin/dist_util.beam bootstrap/lib/kernel/ebin/global.beam bootstrap/lib/kernel/ebin/hipe_unified_loader.beam bootstrap/lib/kernel/ebin/inet_db.beam bootstrap/lib/kernel/ebin/inet_dns.beam bootstrap/lib/kernel/ebin/inet_res.beam bootstrap/lib/kernel/ebin/os.beam bootstrap/lib/kernel/ebin/pg2.beam bootstrap/lib/stdlib/ebin/dets.beam bootstrap/lib/stdlib/ebin/dets_utils.beam bootstrap/lib/stdlib/ebin/erl_tar.beam bootstrap/lib/stdlib/ebin/escript.beam bootstrap/lib/stdlib/ebin/file_sorter.beam bootstrap/lib/stdlib/ebin/otp_internal.beam bootstrap/lib/stdlib/ebin/qlc.beam bootstrap/lib/stdlib/ebin/random.beam bootstrap/lib/stdlib/ebin/supervisor.beam bootstrap/lib/stdlib/ebin/timer.beam erts/aclocal.m4 erts/emulator/beam/bif.c erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_db_hash.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_process.h erts/emulator/beam/erl_thr_progress.c erts/emulator/beam/utils.c erts/emulator/sys/unix/sys.c erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_internal.beam erts/preloaded/ebin/init.beam erts/preloaded/src/erts_internal.erl lib/common_test/test/ct_hooks_SUITE_data/cth/tests/empty_cth.erl lib/diameter/src/base/diameter_lib.erl lib/kernel/src/os.erl lib/ssh/test/ssh_basic_SUITE.erl system/doc/efficiency_guide/advanced.xml
2015-03-20Replace usage of erlang:now() with usage of new APIDan Gudmundsson
2015-03-20Replace usage of erlang:now() with usage of new APIRickard Green
2015-03-11Merge branch 'maint'Dan Gudmundsson
* maint: mnesia: Flush late messages Add Debug info mnesia: better debug info when tests fail mnesia: Ensure tables are loaded before testing them
2015-03-11Merge branch 'dgud/testcasecuddle' into maintDan Gudmundsson
* dgud/testcasecuddle: mnesia: Flush late messages Add Debug info mnesia: better debug info when tests fail mnesia: Ensure tables are loaded before testing them
2015-02-23mnesia: Flush late messagesDan Gudmundsson
2015-02-11Merge branch 'richcarl/dcd-dumps'Zandra Hird
* richcarl/dcd-dumps: Make Mnesia DCD dump behaviour available via API Make Mnesia DCD dump behaviour available via configuration OTP-12481
2015-02-10mnesia: Check nodes after protocol negotiationJean-Sébastien Pédron
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.
2014-12-22Make Mnesia DCD dump behaviour available via APIUlf Wiger
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.