diff options
author | Luke Bakken <lbakken@pivotal.io> | 2020-09-16 14:06:22 -0700 |
---|---|---|
committer | Luke Bakken <lbakken@pivotal.io> | 2020-09-16 14:08:47 -0700 |
commit | 0309b9b7076afabf2b8f17ebc3b878d0f8df8c0f (patch) | |
tree | b09da187314fb6bd0d6f18470e1f81834976e5a0 | |
parent | 48f38874d701e34727b4f482ea42bb0e3e82c460 (diff) | |
download | rabbitmq-server-git-lrb-revert-unintentional-assertion.tar.gz |
Revert unintentional assertionlrb-revert-unintentional-assertion
PR #1818 introduced an unintended assertion here. Previously the record
was updated with the new queue pid. With the change, it became an
assertion.
-rw-r--r-- | src/rabbit_mirror_queue_slave.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rabbit_mirror_queue_slave.erl b/src/rabbit_mirror_queue_slave.erl index 913135f06d..fa1150497d 100644 --- a/src/rabbit_mirror_queue_slave.erl +++ b/src/rabbit_mirror_queue_slave.erl @@ -78,8 +78,8 @@ init(Q) when ?is_amqqueue(Q) -> go(SPid, sync) -> gen_server2:call(SPid, go, infinity); go(SPid, async) -> gen_server2:cast(SPid, go). -handle_go(Q) when ?is_amqqueue(Q) -> - QName = amqqueue:get_name(Q), +handle_go(Q0) when ?is_amqqueue(Q0) -> + QName = amqqueue:get_name(Q0), %% We join the GM group before we add ourselves to the amqqueue %% record. As a result: %% 1. We can receive msgs from GM that correspond to messages we will @@ -113,10 +113,10 @@ handle_go(Q) when ?is_amqqueue(Q) -> ok = rabbit_memory_monitor:register( Self, {rabbit_amqqueue, set_ram_duration_target, [Self]}), {ok, BQ} = application:get_env(backing_queue_module), - QPid = amqqueue:get_pid(Q), - _ = BQ:delete_crashed(Q), %% For crash recovery - BQS = bq_init(BQ, Q, new), - State = #state { q = Q, + Q1 = amqqueue:set_pid(Q0, QPid), + _ = BQ:delete_crashed(Q1), %% For crash recovery + BQS = bq_init(BQ, Q1, new), + State = #state { q = Q1, gm = GM, backing_queue = BQ, backing_queue_state = BQS, @@ -133,7 +133,7 @@ handle_go(Q) when ?is_amqqueue(Q) -> }, ok = gm:broadcast(GM, request_depth), ok = gm:validate_members(GM, [GM | [G || {G, _} <- GMPids]]), - rabbit_mirror_queue_misc:maybe_auto_sync(Q), + rabbit_mirror_queue_misc:maybe_auto_sync(Q1), {ok, State}; {stale, StalePid} -> rabbit_mirror_queue_misc:log_warning( |