Skip to content

Commit a03ebef

Browse files
committed
rabbit_db_*: Add dialyzer ignores for adv API changes
1 parent 210900e commit a03ebef

File tree

8 files changed

+56
-15
lines changed

8 files changed

+56
-15
lines changed

deps/rabbit/src/rabbit_db_exchange.erl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@
5656
khepri_exchange_serial_path/1, khepri_exchange_serial_path/2
5757
]).
5858

59+
%% Ignored because of changes in the Khepri adv API. See comments within
60+
%% these functions.
61+
-dialyzer({nowarn_function, [update_in_khepri/2,
62+
next_serial_in_khepri/1]}).
63+
5964
-define(MNESIA_TABLE, rabbit_exchange).
6065
-define(MNESIA_DURABLE_TABLE, rabbit_durable_exchange).
6166
-define(MNESIA_SERIAL_TABLE, rabbit_exchange_serial).

deps/rabbit/src/rabbit_db_msup.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727

2828
-export([khepri_mirrored_supervisor_path/2]).
2929

30+
%% Ignored because of changes in the Khepri adv API. See comments within
31+
%% these functions.
32+
-dialyzer({nowarn_function, [create_or_update_in_khepri/5]}).
33+
3034
-define(TABLE, mirrored_sup_childspec).
3135
-define(TABLE_DEF,
3236
{?TABLE,

deps/rabbit/src/rabbit_db_queue.erl

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@
7979
-dialyzer({nowarn_function, [foreach_transient/1,
8080
foreach_transient_in_khepri/1]}).
8181

82+
%% Ignored because of changes in the Khepri adv API. See comments within
83+
%% these functions.
84+
-dialyzer({nowarn_function, [delete_in_khepri_tx/2,
85+
update_in_khepri/2,
86+
update_decorators_in_khepri/2,
87+
do_delete_transient_queues_in_khepri_tx/2]}).
88+
8289
-define(MNESIA_TABLE, rabbit_queue).
8390
-define(MNESIA_DURABLE_TABLE, rabbit_durable_queue).
8491

@@ -409,23 +416,26 @@ delete_in_khepri(QueueName) ->
409416
delete_in_khepri(QueueName, OnlyDurable) ->
410417
rabbit_khepri:transaction(
411418
fun () ->
412-
Path = khepri_queue_path(QueueName),
413-
case khepri_tx_adv:delete(Path) of
414-
%% Khepri 0.16 and below returned `khepri:node_props()' for
415-
%% adv queries and commands targeting one node:
416-
{ok, #{data := _}} ->
417-
%% we want to execute some things, as decided by rabbit_exchange,
418-
%% after the transaction.
419-
rabbit_db_binding:delete_for_destination_in_khepri(QueueName, OnlyDurable);
420-
%% Khepri 0.17+ returns `khepri_adv:node_props_map()`
421-
%% instead.
422-
{ok, #{Path := #{data := _}}} ->
423-
rabbit_db_binding:delete_for_destination_in_khepri(QueueName, OnlyDurable);
424-
{ok, _} ->
425-
ok
426-
end
419+
delete_in_khepri_tx(QueueName, OnlyDurable)
427420
end, rw).
428421

422+
delete_in_khepri_tx(QueueName, OnlyDurable) ->
423+
Path = khepri_queue_path(QueueName),
424+
case khepri_tx_adv:delete(Path) of
425+
%% Khepri 0.16 and below returned `khepri:node_props()' for
426+
%% adv queries and commands targeting one node:
427+
{ok, #{data := _}} ->
428+
%% we want to execute some things, as decided by rabbit_exchange,
429+
%% after the transaction.
430+
rabbit_db_binding:delete_for_destination_in_khepri(QueueName, OnlyDurable);
431+
%% Khepri 0.17+ returns `khepri_adv:node_props_map()`
432+
%% instead.
433+
{ok, #{Path := #{data := _}}} ->
434+
rabbit_db_binding:delete_for_destination_in_khepri(QueueName, OnlyDurable);
435+
{ok, _} ->
436+
ok
437+
end.
438+
429439
%% -------------------------------------------------------------------
430440
%% internal_delete().
431441
%% -------------------------------------------------------------------

deps/rabbit/src/rabbit_db_rtparams.erl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
khepri_global_rp_path/1
2323
]).
2424

25+
%% Ignored because of changes in the Khepri adv API. See comments within
26+
%% these functions.
27+
-dialyzer({nowarn_function, [set_in_khepri/2,
28+
set_in_khepri_tx/2]}).
29+
2530
-define(MNESIA_TABLE, rabbit_runtime_parameters).
2631
-define(KHEPRI_GLOBAL_PROJECTION, rabbit_khepri_global_rtparam).
2732
-define(KHEPRI_VHOST_PROJECTION, rabbit_khepri_per_vhost_rtparam).

deps/rabbit/src/rabbit_db_vhost.erl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
]).
5454
-endif.
5555

56+
%% Ignored because of changes in the Khepri adv API. See comments within
57+
%% these functions.
58+
-dialyzer({nowarn_function, [merge_metadata_in_khepri/2,
59+
update_in_khepri/2]}).
60+
5661
-define(MNESIA_TABLE, rabbit_vhost).
5762
-define(KHEPRI_PROJECTION, rabbit_khepri_vhost).
5863

deps/rabbitmq_consistent_hash_exchange/src/rabbit_db_ch_exchange.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
khepri_consistent_hash_path/2
2525
]).
2626

27+
%% Ignored because of changes in the Khepri adv API. See comments within
28+
%% these functions.
29+
-dialyzer({nowarn_function, [create_binding_in_khepri/4]}).
30+
2731
-define(HASH_RING_STATE_TABLE, rabbit_exchange_type_consistent_hash_ring_state).
2832

2933
-rabbit_mnesia_tables_to_khepri_db(

deps/rabbitmq_jms_topic_exchange/src/rabbit_db_jms_exchange.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
khepri_jms_topic_exchange_path/2
2525
]).
2626

27+
%% Ignored because of changes in the Khepri adv API. See comments within
28+
%% these functions.
29+
-dialyzer({nowarn_function, [update_in_khepri/4]}).
30+
2731
-rabbit_mnesia_tables_to_khepri_db(
2832
[{?JMS_TOPIC_TABLE, rabbit_db_jms_exchange_m2k_converter}]).
2933

deps/rabbitmq_recent_history_exchange/src/rabbit_db_rh_exchange.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222

2323
-export([khepri_recent_history_path/1]).
2424

25+
%% Ignored because of changes in the Khepri adv API. See comments within
26+
%% these functions.
27+
-dialyzer({nowarn_function, [insert_in_khepri/3]}).
28+
2529
-rabbit_mnesia_tables_to_khepri_db(
2630
[{?RH_TABLE, rabbit_db_rh_exchange_m2k_converter}]).
2731

0 commit comments

Comments
 (0)