Commit b82ff37
committed
rabbit_maintenance: Replicate
[Why]
So far, the code only ensured the table existed. Because it is a
non-local Mnesia table, its presence on a single node was enough. This
is not what we want here: we want the table to be replicated to all
nodes across the cluster.
This was detected while working on the integration of Khepri. In our
work in progress, the Mnesia table was declared differently and
replicated. This caused mixed-version testing to fail because nodes were
hanging forever while trying to force-load that Mnesia table. The hang
was explained by the fact that the node having that single table copy
was stopped or restarted and thus was unavailable, preventing the load
of the table.
[How]
After the table is declare, we use `rabbit_table:ensure_table_copy/3` to
make sure the table is replicated to the local node. Because all nodes
call that boot step, each of them takes care of configuring its copy. In
the end, the table is replicated everywhere.
V2: We also try to add replicas on remote nodes that don't have one yet.
This reduces the risk of having a node waiting forever that the
table becomes available on another node. Failures to add remote
replicas are ignored as they should not be fatal and prevent the
current node from starting.rabbit_node_maintenance_states Mnesia table1 parent ca6f270 commit b82ff37
1 file changed
+36
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
46 | 78 | | |
47 | 79 | | |
48 | 80 | | |
| |||
0 commit comments