Skip to content

Commit cde967d

Browse files
hairyhumlukebakken
authored andcommitted
wip
1 parent b745e57 commit cde967d

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

src/rabbit_binding.erl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ add(Binding, ActingUser) -> add(Binding, fun (_Src, _Dst) -> ok end, ActingUser)
149149
-spec add(rabbit_types:binding(), inner_fun(), rabbit_types:username()) -> bind_res().
150150

151151
add(Binding, InnerFun, ActingUser) ->
152-
Res = binding_action(
152+
binding_action(
153153
Binding,
154154
fun (Src, Dst, B) ->
155-
Res1 = case rabbit_exchange:validate_binding(Src, B) of
155+
case rabbit_exchange:validate_binding(Src, B) of
156156
ok ->
157157
lock_resource(Src, read),
158158
lock_resource(Dst, read),
@@ -170,12 +170,8 @@ add(Binding, InnerFun, ActingUser) ->
170170
end;
171171
{error, _} = Err ->
172172
rabbit_misc:const(Err)
173-
end,
174-
io:format("Inner action result ~p~n", [Res1]),
175-
Res1
176-
end, fun not_found_or_absent_errs/1),
177-
io:format("Binding action result ~p~n", [Res]),
178-
Res.
173+
end
174+
end, fun not_found_or_absent_errs/1).
179175

180176
add(Src, Dst, B, ActingUser) ->
181177
[SrcDurable, DstDurable] = [durable(E) || E <- [Src, Dst]],

src/rabbit_table.erl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ ensure_secondary_index(Table, Field) ->
7070

7171
create_local_copy(disc) ->
7272
create_local_copy(schema, ram_copies),
73-
create_local_copies(disc);
73+
create_local_copies(ram);
7474
create_local_copy(ram) ->
7575
create_local_copies(ram),
7676
create_local_copy(schema, ram_copies).
@@ -304,6 +304,7 @@ definitions() ->
304304
{rabbit_listener,
305305
[{record_name, listener},
306306
{attributes, record_info(fields, listener)},
307+
{ram_copies, [node()]},
307308
{type, bag},
308309
{match, #listener{_='_'}}]},
309310
{rabbit_durable_route,
@@ -314,32 +315,38 @@ definitions() ->
314315
{rabbit_semi_durable_route,
315316
[{record_name, route},
316317
{attributes, record_info(fields, route)},
318+
{ram_copies, [node()]},
317319
{type, ordered_set},
318320
{match, #route{binding = binding_match(), _='_'}}]},
319321
{rabbit_route,
320322
[{record_name, route},
321323
{attributes, record_info(fields, route)},
324+
{ram_copies, [node()]},
322325
{type, ordered_set},
323326
{match, #route{binding = binding_match(), _='_'}}]},
324327
{rabbit_reverse_route,
325328
[{record_name, reverse_route},
326329
{attributes, record_info(fields, reverse_route)},
330+
{ram_copies, [node()]},
327331
{type, ordered_set},
328332
{match, #reverse_route{reverse_binding = reverse_binding_match(),
329333
_='_'}}]},
330334
{rabbit_topic_trie_node,
331335
[{record_name, topic_trie_node},
332336
{attributes, record_info(fields, topic_trie_node)},
337+
{ram_copies, [node()]},
333338
{type, ordered_set},
334339
{match, #topic_trie_node{trie_node = trie_node_match(), _='_'}}]},
335340
{rabbit_topic_trie_edge,
336341
[{record_name, topic_trie_edge},
337342
{attributes, record_info(fields, topic_trie_edge)},
343+
{ram_copies, [node()]},
338344
{type, ordered_set},
339345
{match, #topic_trie_edge{trie_edge = trie_edge_match(), _='_'}}]},
340346
{rabbit_topic_trie_binding,
341347
[{record_name, topic_trie_binding},
342348
{attributes, record_info(fields, topic_trie_binding)},
349+
{ram_copies, [node()]},
343350
{type, ordered_set},
344351
{match, #topic_trie_binding{trie_binding = trie_binding_match(),
345352
_='_'}}]},
@@ -351,10 +358,12 @@ definitions() ->
351358
{rabbit_exchange,
352359
[{record_name, exchange},
353360
{attributes, record_info(fields, exchange)},
361+
{ram_copies, [node()]},
354362
{match, #exchange{name = exchange_name_match(), _='_'}}]},
355363
{rabbit_exchange_serial,
356364
[{record_name, exchange_serial},
357365
{attributes, record_info(fields, exchange_serial)},
366+
{ram_copies, [node()]},
358367
{match, #exchange_serial{name = exchange_name_match(), _='_'}}]},
359368
{rabbit_runtime_parameters,
360369
[{record_name, runtime_parameters},
@@ -369,6 +378,7 @@ definitions() ->
369378
{rabbit_queue,
370379
[{record_name, amqqueue},
371380
{attributes, amqqueue:fields()},
381+
{ram_copies, [node()]},
372382
{match, amqqueue:pattern_match_on_name(queue_name_match())}]}]
373383
++ gm:table_definitions()
374384
++ mirrored_supervisor:table_definitions().

0 commit comments

Comments
 (0)