Если вы вызываете myObject.method()
, то this
будет ссылаться на myObject
внутри method
.
After some experimentation I've discovered the following:
force_load_table
after the network is partitioned.So to answer my question, one can perform semi online recovery by executing mnesia:stop(), mnesia:start()
on the nodes in the partition whose data you decide to discard (which I'll call the losing partition). Executing the mnesia:start()
call will cause the node to contact the nodes on the other side of the partition. If you have more than one node in the losing partition, you may want to set the master nodes for table loading to nodes in the winning partition - otherwise I think there is a chance it will load tables from another node in the losing partition and thus return to the partitioned network state.
Unfortunately mnesia provides no support for merging/reconciling table contents during the startup table load phase, nor does it provide for going back into the table load phase once started.
A merge phase would be suitable for ejabberd in particular as the node would still have user connections and thus know which user records it owns/should be the most up-to-date for (assuming one user conneciton per cluster). If a merge phase existed, the node could filter userdata tables, save all records for connected users, load tables as per usual and then write the saved records back to the mnesia cluster.
Это работает как это. Вообразите небо полным птиц. Снимите, пока Вы не получили всех птиц. Поместите изображения в таблицу. Изображения карты друг по другу. Таким образом, Вы видите каждую птицу одно время. Вы se каждая птица? Хорошо. Тогда Вы знаете в то время. Система была устойчива. Запись, на что походят все птицы (обменивается сообщениями), и сделайте еще некоторые снимки. Тогда повторитесь.
, Если Вам разделяли узел. Вернитесь к последнему общему устойчивому снимку. И попробуйте ** для воспроизведения то, что добавляет после этого.:)
Это лучше описано в "Распределенных Снимках: Определение Глобальных состояний Распределенных систем" K. MANI CHANDY и LESLIE LAMPORT
** я думаю, что существует проблема, решающая, кто часы для следования при попытке воспроизвести то, что произошло
Ответ Sara является большим, даже посмотрите на статью приблизительно ОГРАНИЧЕНИЕ . Разработчики Mnesia жертвуют P за Приблизительно. Если Вам нужен P, то Вы должны выбор, что из ОГРАНИЧЕНИЯ Вы хотите жертву и, чем выбор другое устройство хранения данных. Например CouchDB (жертвуют C), или Scalaris (жертвуют A).