问题描述
我有两个节点运行mnesia。我在节点1 上创建了模式和一些表,并在节点2上使用 mnesia:add_table_copy
I have two nodes running mnesia. I created schema and some tables on node 1, and used mnesia:add_table_copy
on node 2 to copy the tables from node 1 to node 2.
一切正常,直到我调用 q()
然后在节点2 上的 q()
我发现当我再次启动节点1 时, mnesia:wait_for_tables([sometable],infinity)
它只会在我再次启动节点2 时返回。
Everything works well until I call q()
on node 1 and then q()
on node 2. I found that when I start node 1 again, mnesia:wait_for_tables([sometable], infinity)
won't return. It will only return when I start node 2 again.
有办法解决这个问题吗?这是一个问题,因为如果节点2 关闭,我将无法再次启动节点1 。
Is there a way to fix this? This is a problem because I won't be able to start node 1 again if node 2 is down.
推荐答案
在功能:
Also, it should be possible to force the table loading via the force_load_table/1 function:
force_load_table(Tab) -> yes | ErrorDescription
如果这种情况不被接受,
这个函数可以用来覆盖
Mnesia表的策略load
算法。这可能导致
情况,其中一些事务
效果丢失与作为结果的不一致的
数据库,但对于一些
应用程序高可用性更多
比一致性数据。
If this situation is not acceptable, this function can be used to override the strategy of the Mnesia table load algorithm. This could lead to a situation where some transaction effects are lost with a inconsistent database as result, but for some applications high availability is more important than consistent data.
这篇关于关于mnesia分布的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!