From 15470a23517d911ef91e58d893c3210fbee9c4c5 Mon Sep 17 00:00:00 2001 From: Ayanda Dube Date: Tue, 1 Oct 2024 14:32:37 +0100 Subject: [PATCH 1/5] add support for the leader info item in classic queues (cherry picked from commit 22b433efb48d1afcb6f3f00173b0f948ccb4127e) --- deps/rabbit/src/rabbit_amqqueue_process.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deps/rabbit/src/rabbit_amqqueue_process.erl b/deps/rabbit/src/rabbit_amqqueue_process.erl index f1daf31f0a94..5e3e966ddcdb 100644 --- a/deps/rabbit/src/rabbit_amqqueue_process.erl +++ b/deps/rabbit/src/rabbit_amqqueue_process.erl @@ -119,7 +119,8 @@ arguments, owner_pid, exclusive, - user_who_performed_action + user_who_performed_action, + leader ]). -define(INFO_KEYS, [pid | ?CREATION_EVENT_KEYS ++ ?STATISTICS_KEYS -- [name, type]]). @@ -1083,6 +1084,7 @@ i(auto_delete, #q{q = Q}) -> amqqueue:is_auto_delete(Q); i(arguments, #q{q = Q}) -> amqqueue:get_arguments(Q); i(pid, _) -> self(); +i(leader, State) -> node(i(pid, State)); i(owner_pid, #q{q = Q}) when ?amqqueue_exclusive_owner_is(Q, none) -> ''; i(owner_pid, #q{q = Q}) -> From 4c72ec917b3e6df85d22e6f852e596bdd151e3f2 Mon Sep 17 00:00:00 2001 From: Ayanda Dube Date: Tue, 1 Oct 2024 14:39:36 +0100 Subject: [PATCH 2/5] test and assert new classic queue leader info item (cherry picked from commit f9e5d349df85cd5a4d344e0178803d8e0ffb7695) --- deps/rabbit/test/classic_queue_SUITE.erl | 1 + 1 file changed, 1 insertion(+) diff --git a/deps/rabbit/test/classic_queue_SUITE.erl b/deps/rabbit/test/classic_queue_SUITE.erl index 5b54d7150fb0..e1e828124ffb 100644 --- a/deps/rabbit/test/classic_queue_SUITE.erl +++ b/deps/rabbit/test/classic_queue_SUITE.erl @@ -83,6 +83,7 @@ leader_locator_client_local(Config) -> {<<"x-queue-leader-locator">>, longstr, <<"client-local">>}])), {ok, Leader0} = rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, lookup, [rabbit_misc:r(<<"/">>, queue, Q)]), Leader = amqqueue:qnode(Leader0), + ?assertEqual([{leader, Leader}], rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, info, [Leader0, [leader]])), ?assertEqual(Server, Leader), ?assertMatch(#'queue.delete_ok'{}, amqp_channel:call(Ch, #'queue.delete'{queue = Q})) From 6a9f9f65427ad1ac6fc68764742bc69236fb8161 Mon Sep 17 00:00:00 2001 From: Ayanda Dube Date: Wed, 2 Oct 2024 13:34:48 +0100 Subject: [PATCH 3/5] support members info item in classic queues, which will always be the leader (cherry picked from commit 71f921c09072e23fa72e44bebd1cc30be690062d) --- deps/rabbit/src/rabbit_amqqueue_process.erl | 4 +++- deps/rabbit/test/classic_queue_SUITE.erl | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/deps/rabbit/src/rabbit_amqqueue_process.erl b/deps/rabbit/src/rabbit_amqqueue_process.erl index 5e3e966ddcdb..63f886bd3763 100644 --- a/deps/rabbit/src/rabbit_amqqueue_process.erl +++ b/deps/rabbit/src/rabbit_amqqueue_process.erl @@ -120,7 +120,8 @@ owner_pid, exclusive, user_who_performed_action, - leader + leader, + members ]). -define(INFO_KEYS, [pid | ?CREATION_EVENT_KEYS ++ ?STATISTICS_KEYS -- [name, type]]). @@ -1085,6 +1086,7 @@ i(arguments, #q{q = Q}) -> amqqueue:get_arguments(Q); i(pid, _) -> self(); i(leader, State) -> node(i(pid, State)); +i(members, State) -> [i(leader, State)]; i(owner_pid, #q{q = Q}) when ?amqqueue_exclusive_owner_is(Q, none) -> ''; i(owner_pid, #q{q = Q}) -> diff --git a/deps/rabbit/test/classic_queue_SUITE.erl b/deps/rabbit/test/classic_queue_SUITE.erl index e1e828124ffb..1336c6bdbcd4 100644 --- a/deps/rabbit/test/classic_queue_SUITE.erl +++ b/deps/rabbit/test/classic_queue_SUITE.erl @@ -83,7 +83,8 @@ leader_locator_client_local(Config) -> {<<"x-queue-leader-locator">>, longstr, <<"client-local">>}])), {ok, Leader0} = rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, lookup, [rabbit_misc:r(<<"/">>, queue, Q)]), Leader = amqqueue:qnode(Leader0), - ?assertEqual([{leader, Leader}], rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, info, [Leader0, [leader]])), + ?assertEqual([{leader, Leader}, {members, [Leader]}], + rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, info, [Leader0, [leader, members]])), ?assertEqual(Server, Leader), ?assertMatch(#'queue.delete_ok'{}, amqp_channel:call(Ch, #'queue.delete'{queue = Q})) From bca13ec6cfe2edcc2c4acd59fdd413794fc9415b Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Wed, 2 Oct 2024 16:06:51 -0400 Subject: [PATCH 4/5] Actions: align google-github-actions/auth versions (cherry picked from commit 0b2d4d78bb59ad05df17f5b841ec5550ceb1f81a) --- .github/workflows/templates/test-mixed-versions.template.yaml | 2 +- .github/workflows/templates/test.template.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/templates/test-mixed-versions.template.yaml b/.github/workflows/templates/test-mixed-versions.template.yaml index 94747911f974..02135223e45b 100644 --- a/.github/workflows/templates/test-mixed-versions.template.yaml +++ b/.github/workflows/templates/test-mixed-versions.template.yaml @@ -96,7 +96,7 @@ jobs: https://builds.hex.pm https://cdn.jsdelivr.net/hex - name: AUTHENTICATE TO GOOGLE CLOUD - uses: google-github-actions/auth@v2.1.5 + uses: google-github-actions/auth@v2.1.6 with: credentials_json: ${{ secrets.REMOTE_CACHE_CREDENTIALS_JSON }} - name: BUILD SECONDARY UMBRELLA ARCHIVE diff --git a/.github/workflows/templates/test.template.yaml b/.github/workflows/templates/test.template.yaml index bf2dfdf631c6..be79483d462c 100644 --- a/.github/workflows/templates/test.template.yaml +++ b/.github/workflows/templates/test.template.yaml @@ -73,7 +73,7 @@ jobs: run: | echo "value=bazel-repo-cache-${{ hashFiles('MODULE.bazel') }}" | tee -a $GITHUB_OUTPUT - name: AUTHENTICATE TO GOOGLE CLOUD - uses: google-github-actions/auth@v2.1.5 + uses: google-github-actions/auth@v2.1.6 with: credentials_json: ${{ secrets.REMOTE_CACHE_CREDENTIALS_JSON }} - name: REPO CACHE From e518d4302e88060729ab85a3a66792aaa5f65509 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Thu, 3 Oct 2024 01:12:39 -0400 Subject: [PATCH 5/5] This assertion does not belong to this leader-locator test (cherry picked from commit 232798c12a8090ed773c3ed8c772b94bee206614) --- deps/rabbit/test/classic_queue_SUITE.erl | 2 -- 1 file changed, 2 deletions(-) diff --git a/deps/rabbit/test/classic_queue_SUITE.erl b/deps/rabbit/test/classic_queue_SUITE.erl index 1336c6bdbcd4..5b54d7150fb0 100644 --- a/deps/rabbit/test/classic_queue_SUITE.erl +++ b/deps/rabbit/test/classic_queue_SUITE.erl @@ -83,8 +83,6 @@ leader_locator_client_local(Config) -> {<<"x-queue-leader-locator">>, longstr, <<"client-local">>}])), {ok, Leader0} = rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, lookup, [rabbit_misc:r(<<"/">>, queue, Q)]), Leader = amqqueue:qnode(Leader0), - ?assertEqual([{leader, Leader}, {members, [Leader]}], - rabbit_ct_broker_helpers:rpc(Config, Server, rabbit_amqqueue, info, [Leader0, [leader, members]])), ?assertEqual(Server, Leader), ?assertMatch(#'queue.delete_ok'{}, amqp_channel:call(Ch, #'queue.delete'{queue = Q}))